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

Unified Diff: trunk/src/cc/resources/bitmap_content_layer_updater.cc

Issue 100923002: Revert 225751 "BitmapContentLayerUpdater shouldn't reallocate bi..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years 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 | « no previous file | trunk/src/cc/resources/content_layer_updater.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/cc/resources/bitmap_content_layer_updater.cc
===================================================================
--- trunk/src/cc/resources/bitmap_content_layer_updater.cc (revision 238277)
+++ trunk/src/cc/resources/bitmap_content_layer_updater.cc (working copy)
@@ -61,8 +61,7 @@
gfx::Rect* resulting_opaque_rect) {
devtools_instrumentation::ScopedLayerTask paint_layer(
devtools_instrumentation::kPaintLayer, layer_id_);
- if (canvas_size_.width() < content_rect.size().width() ||
- canvas_size_.height() < content_rect.size().height()) {
+ if (canvas_size_ != content_rect.size()) {
devtools_instrumentation::ScopedLayerTask paint_setup(
devtools_instrumentation::kPaintSetup, layer_id_);
canvas_size_ = content_rect.size();
@@ -77,7 +76,7 @@
base::TimeTicks start_time =
rendering_stats_instrumentation_->StartRecording();
PaintContents(canvas_.get(),
- content_rect,
+ content_rect.origin(),
contents_width_scale,
contents_height_scale,
resulting_opaque_rect);
@@ -94,10 +93,12 @@
gfx::Vector2d dest_offset,
bool partial_update) {
CHECK(canvas_);
- gfx::Rect canvas_rect = content_rect();
- canvas_rect.set_size(canvas_size_);
- ResourceUpdate upload = ResourceUpdate::CreateFromCanvas(
- texture, canvas_, canvas_rect, source_rect, dest_offset);
+ ResourceUpdate upload =
+ ResourceUpdate::CreateFromCanvas(texture,
+ canvas_,
+ content_rect(),
+ source_rect,
+ dest_offset);
if (partial_update)
queue->AppendPartialUpload(upload);
else
« no previous file with comments | « no previous file | trunk/src/cc/resources/content_layer_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698