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

Unified Diff: cc/resources/content_layer_updater.cc

Issue 24486002: BitmapContentLayerUpdater shouldn't reallocate bitmap smaller. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 2e73c4bb904d587e9a3c9935ba827d0ba20ec0c9..92cabf2c66da9175da7cde477688eb4e353224e1 100644
--- a/cc/resources/content_layer_updater.cc
+++ b/cc/resources/content_layer_updater.cc
@@ -35,20 +35,22 @@ void ContentLayerUpdater::set_rendering_stats_instrumentation(
}
void ContentLayerUpdater::PaintContents(SkCanvas* canvas,
- gfx::Point origin,
+ gfx::Rect content_rect,
float contents_width_scale,
float contents_height_scale,
gfx::Rect* resulting_opaque_rect) {
- TRACE_EVENT0("cc", "ContentLayerUpdater::PaintContents");
+ TRACE_EVENT2("cc",
+ "ContentLayerUpdater::PaintContents",
+ "width",
+ content_rect.width(),
+ "height",
+ content_rect.height());
+ gfx::Point origin = content_rect.origin();
canvas->save();
canvas->translate(SkFloatToScalar(-origin.x()),
SkFloatToScalar(-origin.y()));
- SkBaseDevice* device = canvas->getDevice();
- gfx::Rect content_rect(origin, gfx::Size(device->width(), device->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