Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5338)

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2292713002: Clear the scaled bitmap before drawing into it for huge UIResources. (Closed)
Patch Set: uninit-scrollbars: . Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/data/spiral_64_scale.png ('k') | cc/trees/layer_tree_host_pixeltest_scrollbars.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index f46d3cddfba829d2c71428b1f699eddaea703af4..2ec8f709dc2add212eb5f63ffc57fd2fa8bf4ee9 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -3820,6 +3820,11 @@ void LayerTreeHostImpl::CreateUIResource(UIResourceId uid,
scaled_bitmap.allocN32Pixels(upload_size.width(), upload_size.height());
SkCanvas scaled_canvas(scaled_bitmap);
scaled_canvas.scale(canvas_scale_x, canvas_scale_y);
+ // The |canvas_scale_x| and |canvas_scale_y| may have some floating point
+ // error for large enough values, causing pixels on the edge to be not
+ // fully filled by drawBitmap(), so we ensure they start empty. (See
+ // crbug.com/642011 for an example.)
+ scaled_canvas.clear(SK_ColorTRANSPARENT);
scaled_canvas.drawBitmap(source_bitmap, 0, 0);
SkAutoLockPixels scaled_bitmap_lock(scaled_bitmap);
« no previous file with comments | « cc/test/data/spiral_64_scale.png ('k') | cc/trees/layer_tree_host_pixeltest_scrollbars.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698