Overdraw is an excessive redrawing of the same pixels multiple times per frame. When a complex interface with many overlapping elements is displayed on the screen, the GPU has to process each pixel repeatedly, which directly affects frame rate and power consumption. According to Google Android Developer Documentation, 2025, reducing overdraw by 50% can increase rendering performance by up to 30%. Overdraw optimization is a mandatory step when developing applications with smooth animation and responsive interfaces.
Key Takeaways
Overdraw is a situation where the same screen pixel is redrawn multiple times within a single render frame. In an ideal scenario, each pixel should be written exactly once, but in real interfaces due to nested Views, background images and transparent layers, the GPU performs repeated writes.
Each additional redraw increases the frame render time. At a standard 60 FPS rate, each frame gets approximately 16.6 ms. If overdraw causes this limit to be exceeded, the frame rate drops to 30 FPS or lower, which noticeably degrades interface smoothness.
According to Android Performance Patterns by Google, an app with a 3x overdraw factor spends three times more time on the fragment shader than an app with 1x overdraw. On low-performance GPU devices, this leads to noticeable lag during scrolling and animation.
For mobile developers, understanding overdraw is critically important: this factor most often causes jerky scrolling and low frame rates in seemingly simple screens with a large number of nested elements.
The GPU pipeline consists of several stages: vertex shader, rasterization, and fragment shader. The fragment shader is the most expensive part because it executes for every pixel of every primitive. With 2x overdraw, the fragment shader processes twice as many pixels, which directly increases frame time.
Modern mobile GPUs such as Qualcomm Adreno and Apple GPU have Early-Z Test and Hidden Surface Removal mechanisms that partially compensate for overdraw. However, these optimizations only work under certain conditions, and one should not rely solely on hardware acceleration.
For example, when rendering semi-transparent elements, hardware Early-Z is ineffective, and each pixel is processed fully — overdraw in such scenarios can reach 5x and higher.
Multi-layered backgrounds are one of the main causes of overdraw in mobile apps. When an Activity or ViewController sets a background color, each nested View can add its own background, and the pixel is redrawn at every hierarchy level.
A study by Uber Engineering showed that removing excessive backgrounds in their Android app reduced overdraw by 32% and screen rendering time by 25%. A similar situation exists in iOS: setting opaque = true for non-transparent Views eliminates alpha blending and prevents multiple pixel writes.
On the iOS platform, overdraw often occurs due to the use of transparent UIStackView, CALayer with shouldRasterize, and overlapping UIBlurEffect. Apple recommends checking overdraw through the Core Animation tool in XCode — it shows redraw zones as a red overlay.
Debug GPU Overdraw is a built-in Android tool that colors the screen differently depending on the overdraw factor. Purple means 1x, blue — 2x, green — 3x, pink — 4x, red — 5x or more. An ideal screen should be mostly purple.
In iOS, similar diagnostics are performed by the Core Animation tool in XCode Instruments. It visualizes redraw zones and shows the exact number of pixel writes in Color Blended Layers mode. Green layers are opaque (optimal), red ones contain transparency and cause overdraw.
After diagnosis, it is important to measure FPS before and after optimization. A difference of 10–15 FPS when fixing overdraw is a normal result for a complex screen with lists and animation.
Removing excessive backgrounds is the simplest and most effective method. On Android, just set android:windowBackground only for the Activity or theme, not for each View. On iOS, opaque = true for all non-transparent UIView reduces overdraw to almost zero for those elements.
According to Google I/O 2019, overdraw optimization in Google Maps allowed reducing frame render time by 40% through layer merging and using ClipRect to limit the drawing area. For Android developers, Google recommends the following practices:
In iOS, optimization is achieved through CALayer configuration: setting masksToBounds = true clips content beyond the layer bounds, and shouldRasterize enables bitmap caching for static layers.
Let’s look at practical examples in Kotlin and Swift demonstrating typical overdraw elimination scenarios. The first example shows optimization through ClipRect in Android:
class OptimizedView@JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null
) : View(context, attrs) {
override fun onDraw(canvas: Canvas) {
canvas.clipRect(
paddingLeft.toFloat(), paddingTop.toFloat(),
width - paddingRight.toFloat(), height - paddingBottom.toFloat()
)
// Draw content only within clipped area
super.onDraw(canvas)
}
}
The second example in Swift shows disabling transparency for a layer if the element should not be semi-transparent:
class OpaqueLabel: UILabel {
override var isOpaque: Bool {
get { true }
set { }
}
override func draw(_ rect: CGRect) {
backgroundColor?.setFill()
UIRectFill(rect)
super.draw(rect)
}
}
The third example demonstrates using ViewStub for deferred map loading in Android. ViewStub does not render until it becomes visible, which eliminates overdraw at the screen initialization stage:
<!-- layout/activity_main.xml -->
<ViewStub
android:id="@+id/map_stub"
android:layout_width="match_parent"
android:layout_height="200dp"
android:inflatedId="@+id/map_container"
android:layout="@layout/map_fragment" />
// Inflate on demand
ViewStub stub = findViewById(R.id.map_stub)
stub?.inflate()
Frequently Asked Questions
Overdraw is when a pixel on the screen is redrawn multiple times in one frame. Imagine you are painting a sheet of paper, and then sticking several transparent films with drawings on top — the lower layers have to be redrawn every time the top layer changes.
Enable Debug GPU Overdraw in the developer settings. Elements with 1x overdraw are colored purple, 2x — blue, 3x — green, 4x — pink, 5x+ — red. An optimal screen is mostly purple without red zones.
Each additional pixel redraw requires a call to the fragment shader, which processes color, texture, and lighting. At 60 FPS, each frame gets 16.6 ms — if overdraw forces the GPU to process 2–3 times more pixels, the limit is exceeded and FPS drops to 30.
Yes, directly. A GPU performing excessive work consumes more energy. According to Google’s research, reducing overdraw from 4x to 1x decreases GPU power consumption by 35–50%, which is especially noticeable on high-resolution displays.
For simple screens — 1x–1.5x (purple with a small amount of blue). For complex interfaces — up to 2x. Levels of 3x and higher (pink, red) require optimization. Google recommends not exceeding 2.5x overdraw on average across the screen.
Summary
We will develop a mobile application turnkey
IT Sectr creates iOS and Android applications for startups and businesses since 2017. We will advise you and propose the best solution.
Read also