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

Unified Diff: cc/picture.h

Issue 12316084: cc: Consolidate the analysis_canvas operations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reveman's review Created 7 years, 10 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
Index: cc/picture.h
diff --git a/cc/picture.h b/cc/picture.h
index 118bcb39a5c4fc32a241335e8fde1290cb6190ff..4ee1e0c1bd6840551480f609e03feb48ddf6ebfc 100644
--- a/cc/picture.h
+++ b/cc/picture.h
@@ -16,6 +16,10 @@
#include "third_party/skia/include/core/SkPixelRef.h"
#include "ui/gfx/rect.h"
+namespace skia {
+ class AnalysisCanvas;
+} // namespace skia
+
namespace cc {
class ContentLayerClient;
@@ -42,10 +46,19 @@ class CC_EXPORT Picture
// Apply this contents scale and raster the content rect into the canvas.
void Raster(SkCanvas* canvas, gfx::Rect content_rect, float contents_scale);
- // Estimate the cost of rasterizing. To predict the cost of a particular
- // call to Raster(), pass this the bounds of the canvas that will
- // be rastered into.
- bool IsCheapInRect(const gfx::Rect& layer_rect) const;
+ struct Analysis {
+ Analysis();
+
+ bool is_solid_color;
+ bool is_transparent;
+ bool is_cheap_to_raster;
+ SkColor solid_color;
+ };
+
+ void AnalyzeInRect(skia::AnalysisCanvas* canvas,
+ const gfx::Rect& content_rect,
+ float contents_scale,
+ Analysis* analysis);
void GatherPixelRefs(
const gfx::Rect& layer_rect,
« no previous file with comments | « cc/layer_tree_settings.cc ('k') | cc/picture.cc » ('j') | cc/picture_pile_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698