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

Unified Diff: cc/picture.cc

Issue 12316084: cc: Consolidate the analysis_canvas operations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win warning fix Created 7 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/picture.h ('k') | cc/picture_layer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/picture.cc
diff --git a/cc/picture.cc b/cc/picture.cc
index 10046108e0402f951d462877b8f5070247a659fb..d1f5b79072dff796fbdf5b271ff27798c4cb50b9 100644
--- a/cc/picture.cc
+++ b/cc/picture.cc
@@ -130,17 +130,15 @@ void Picture::Raster(
canvas->restore();
}
-bool Picture::IsCheapInRect(const gfx::Rect& layer_rect) const {
- TRACE_EVENT0("cc", "Picture::IsCheapInRect");
-
- SkBitmap emptyBitmap;
- emptyBitmap.setConfig(SkBitmap::kNo_Config, layer_rect.width(),
- layer_rect.height());
- skia::AnalysisDevice device(emptyBitmap);
- skia::AnalysisCanvas canvas(&device);
-
- canvas.drawPicture(*picture_);
- return canvas.isCheap();
+void Picture::AnalyzeInRect(skia::AnalysisCanvas* canvas,
+ const gfx::Rect& content_rect,
+ float contents_scale) {
+ canvas->save();
+ canvas->clipRect(gfx::RectToSkRect(content_rect));
+ canvas->scale(contents_scale, contents_scale);
+ canvas->translate(layer_rect_.x(), layer_rect_.y());
+ canvas->drawPicture(*picture_);
+ canvas->restore();
}
void Picture::GatherPixelRefs(const gfx::Rect& layer_rect,
« no previous file with comments | « cc/picture.h ('k') | cc/picture_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698