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

Unified Diff: cc/resources/content_layer_updater.cc

Issue 222573002: cc: Add CHECKs that the backing size reported by canvas matches. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: contentupdatercrash: Created 6 years, 9 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/resources/content_layer_updater.h ('k') | cc/resources/skpicture_content_layer_updater.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/content_layer_updater.cc
diff --git a/cc/resources/content_layer_updater.cc b/cc/resources/content_layer_updater.cc
index f0711df4953e4b070b216252e1781590e9dbaa03..3c18d8a61204128dc80271499c811f78a68b3c25 100644
--- a/cc/resources/content_layer_updater.cc
+++ b/cc/resources/content_layer_updater.cc
@@ -35,20 +35,21 @@ void ContentLayerUpdater::set_rendering_stats_instrumentation(
}
void ContentLayerUpdater::PaintContents(SkCanvas* canvas,
- const gfx::Point& origin,
+ const gfx::Rect& content_rect,
float contents_width_scale,
float contents_height_scale,
gfx::Rect* resulting_opaque_rect) {
TRACE_EVENT0("cc", "ContentLayerUpdater::PaintContents");
canvas->save();
- canvas->translate(SkFloatToScalar(-origin.x()),
- SkFloatToScalar(-origin.y()));
+ canvas->translate(SkFloatToScalar(-content_rect.x()),
+ SkFloatToScalar(-content_rect.y()));
- SkISize size = canvas->getDeviceSize();
- gfx::Rect content_rect(origin, gfx::Size(size.width(), size.height()));
+ // The |canvas| backing should be sized to hold the |content_rect|.
+ SkISize size = canvas->getBaseLayerSize();
+ CHECK_EQ(content_rect.width(), size.width());
+ CHECK_EQ(content_rect.height(), size.height());
gfx::Rect layer_rect = content_rect;
-
if (contents_width_scale != 1.f || contents_height_scale != 1.f) {
canvas->scale(SkFloatToScalar(contents_width_scale),
SkFloatToScalar(contents_height_scale));
« no previous file with comments | « cc/resources/content_layer_updater.h ('k') | cc/resources/skpicture_content_layer_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698