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

Unified Diff: cc/resources/bitmap_content_layer_updater.cc

Issue 23484005: Skip clearing the canvas before painting the contents of opaque layers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unecessary newline Created 7 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 | « no previous file | cc/resources/content_layer_updater.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/bitmap_content_layer_updater.cc
diff --git a/cc/resources/bitmap_content_layer_updater.cc b/cc/resources/bitmap_content_layer_updater.cc
index 3d90eb0a4d566fbf82dbf258452021230f6fd46f..75b99c54b81fedb7dfe94355634acbc05706002a 100644
--- a/cc/resources/bitmap_content_layer_updater.cc
+++ b/cc/resources/bitmap_content_layer_updater.cc
@@ -43,8 +43,7 @@ BitmapContentLayerUpdater::BitmapContentLayerUpdater(
scoped_ptr<LayerPainter> painter,
RenderingStatsInstrumentation* stats_instrumentation,
int layer_id)
- : ContentLayerUpdater(painter.Pass(), stats_instrumentation, layer_id),
- opaque_(false) {}
+ : ContentLayerUpdater(painter.Pass(), stats_instrumentation, layer_id) {}
BitmapContentLayerUpdater::~BitmapContentLayerUpdater() {}
@@ -67,13 +66,13 @@ void BitmapContentLayerUpdater::PrepareToUpdate(
devtools_instrumentation::kPaintSetup, layer_id_);
canvas_size_ = content_rect.size();
canvas_ = skia::AdoptRef(skia::CreateBitmapCanvas(
- canvas_size_.width(), canvas_size_.height(), opaque_));
+ canvas_size_.width(), canvas_size_.height(), layer_is_opaque_));
}
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);
@@ -108,11 +107,12 @@ void BitmapContentLayerUpdater::ReduceMemoryUsage() {
}
void BitmapContentLayerUpdater::SetOpaque(bool opaque) {
- if (opaque != opaque_) {
+ if (opaque != layer_is_opaque_) {
canvas_.clear();
canvas_size_ = gfx::Size();
}
- opaque_ = opaque;
+
+ ContentLayerUpdater::SetOpaque(opaque);
}
} // namespace cc
« no previous file with comments | « no previous file | cc/resources/content_layer_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698