Index: cc/tile_drawing_info.h |
diff --git a/cc/tile_drawing_info.h b/cc/tile_drawing_info.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a25c070f131061dfd4039e32380f511439827a18 |
--- /dev/null |
+++ b/cc/tile_drawing_info.h |
@@ -0,0 +1,56 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CC_TILE_DRAWING_INFO_H_ |
+#define CC_TILE_DRAWING_INFO_H_ |
+ |
+#include "cc/resource_provider.h" |
+#include "cc/tile_manager.h" |
+ |
+namespace cc { |
+ |
+class Tile; |
+ |
+class CC_EXPORT TileDrawingInfo { |
enne (OOO)
2013/02/27 22:13:57
I'm not really convinced that Tile is so complicat
|
+ public: |
+ enum Mode { |
+ TEXTURE_MODE, |
+ SOLID_COLOR_MODE, |
+ TRANSPARENT_MODE, |
+ PICTURE_PILE_MODE, |
+ NUM_MODES |
+ }; |
+ |
+ TileDrawingInfo(const Tile* tile) |
+ : mode_(TEXTURE_MODE), |
+ tile_(tile) {} |
+ |
+ Mode mode() const { |
+ return mode_; |
+ } |
+ |
+ bool is_ready_to_draw() const; |
enne (OOO)
2013/02/27 22:13:57
style nit: don't name functions using hacker_style
|
+ |
+ ResourceProvider::ResourceId get_resource_id() const; |
enne (OOO)
2013/02/27 22:13:57
style nit: don't name functions using hacker_style
|
+ |
+ SkColor get_solid_color() const { |
+ DCHECK(mode_ == SOLID_COLOR_MODE); |
+ |
+ return solid_color_; |
+ } |
+ |
+ private: |
+ friend class TileManager; |
+ |
+ Mode mode_; |
+ const Tile* tile_; |
+ SkColor solid_color_; |
+ |
+ void set_transparent(); |
+ void set_solid_color(const SkColor& color); |
+}; |
+ |
+} // namespace cc |
+ |
+#endif // CC_TILE_DRAWING_INFO_H_ |