Index: cc/layers/layer_impl.h |
diff --git a/cc/layers/layer_impl.h b/cc/layers/layer_impl.h |
index fbe0963042b2c8030d94e1b182c237fd6259007c..a52258c791fefb357c32cf869c73fafbdcfed87e 100644 |
--- a/cc/layers/layer_impl.h |
+++ b/cc/layers/layer_impl.h |
@@ -49,6 +49,14 @@ class Layer; |
struct AppendQuadsData; |
+// TODO(boliu): move to somewhere in cc/base? |
+enum DrawMode { |
+ DRAW_MODE_NONE, |
+ DRAW_MODE_HARDWARE, |
+ DRAW_MODE_SOFTWARE, |
+ DRAW_MODE_RESOURCELESS_SOFTWARE |
+}; |
+ |
class CC_EXPORT LayerImpl : LayerAnimationValueObserver { |
public: |
static scoped_ptr<LayerImpl> Create(LayerTreeImpl* tree_impl, int id) { |
@@ -99,11 +107,13 @@ class CC_EXPORT LayerImpl : LayerAnimationValueObserver { |
LayerTreeImpl* layer_tree_impl() const { return layer_tree_impl_; } |
scoped_ptr<SharedQuadState> CreateSharedQuadState() const; |
+ // TODO(boliu): update comment before commit |
// WillDraw must be called before AppendQuads. If WillDraw is called, |
// DidDraw is guaranteed to be called before another WillDraw or before |
// the layer is destroyed. To enforce this, any class that overrides |
// WillDraw/DqidDraw must call the base class version. |
- virtual void WillDraw(ResourceProvider* resource_provider); |
+ virtual bool WillDraw(DrawMode draw_mode, |
+ ResourceProvider* resource_provider); |
virtual void AppendQuads(QuadSink* quad_sink, |
AppendQuadsData* append_quads_data) {} |
virtual void DidDraw(ResourceProvider* resource_provider); |
@@ -530,9 +540,10 @@ class CC_EXPORT LayerImpl : LayerAnimationValueObserver { |
WebKit::WebFilterOperations background_filters_; |
skia::RefPtr<SkImageFilter> filter_; |
-#ifndef NDEBUG |
- bool between_will_draw_and_did_draw_; |
-#endif |
+ protected: |
+ DrawMode current_draw_mode_; |
+ |
+ private: |
// Rect indicating what was repainted/updated during update. |
// Note that plugin layers bypass this and leave it empty. |