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

Unified Diff: skia/ext/analysis_canvas.h

Issue 12388095: cc: Merge GatherPixelRefs and AnalyzeInRect (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update 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
Index: skia/ext/analysis_canvas.h
diff --git a/skia/ext/analysis_canvas.h b/skia/ext/analysis_canvas.h
index fd7ee25c56863a8973738de99e4ec9364425967a..70b59166975aebc4a1675286331027e7c964b430 100644
--- a/skia/ext/analysis_canvas.h
+++ b/skia/ext/analysis_canvas.h
@@ -5,6 +5,10 @@
#ifndef SKIA_EXT_ANALYSIS_CANVAS_H_
#define SKIA_EXT_ANALYSIS_CANVAS_H_
+#include <list>
+#include <set>
+
+#include "skia/ext/lazy_pixel_ref.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkDevice.h"
@@ -28,6 +32,7 @@ class SK_API AnalysisCanvas : public SkCanvas {
bool isCheap() const;
bool getColorIfSolid(SkColor* color) const;
bool isTransparent() const;
+ void consumeLazyPixelRefs(std::list<LazyPixelRef*>& pixelRefs);
// Returns the estimated cost of drawing, in arbitrary units.
int getEstimatedCost() const;
@@ -65,6 +70,7 @@ class SK_API AnalysisDevice : public SkDevice {
int getEstimatedCost() const;
bool getColorIfSolid(SkColor* color) const;
bool isTransparent() const;
+ void consumeLazyPixelRefs(std::list<LazyPixelRef*>& pixelRefs);
void setForceNotSolid(bool flag);
void setForceNotTransparent(bool flag);
@@ -120,13 +126,20 @@ class SK_API AnalysisDevice : public SkDevice {
int estimatedCost_;
private:
+
typedef SkDevice INHERITED;
+ void addPixelRefIfLazy(SkPixelRef* pixelRef);
+ void addBitmap(const SkBitmap& bitmap);
+ void addBitmapFromPaint(const SkPaint& paint);
+
bool isForcedNotSolid_;
bool isForcedNotTransparent_;
bool isSolidColor_;
SkColor color_;
bool isTransparent_;
+ std::set<uint32_t> existingPixelRefIDs_;
Justin Novosad 2013/03/11 15:26:11 for performance, this should be an std::unordered_
+ std::list<skia::LazyPixelRef*> lazyPixelRefs_;
};
} // namespace skia
« no previous file with comments | « cc/tile_manager.cc ('k') | skia/ext/analysis_canvas.cc » ('j') | skia/ext/analysis_canvas.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698