| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_RESOURCES_LAYER_UPDATER_H_ | 5 #ifndef CC_RESOURCES_LAYER_UPDATER_H_ |
| 6 #define CC_RESOURCES_LAYER_UPDATER_H_ | 6 #define CC_RESOURCES_LAYER_UPDATER_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
| 11 #include "third_party/skia/include/core/SkColor.h" |
| 11 #include "ui/gfx/rect.h" | 12 #include "ui/gfx/rect.h" |
| 12 #include "ui/gfx/vector2d.h" | 13 #include "ui/gfx/vector2d.h" |
| 13 | 14 |
| 14 namespace cc { | 15 namespace cc { |
| 15 | 16 |
| 16 class PrioritizedResource; | 17 class PrioritizedResource; |
| 17 class PrioritizedResourceManager; | 18 class PrioritizedResourceManager; |
| 18 class ResourceUpdateQueue; | 19 class ResourceUpdateQueue; |
| 19 class TextureManager; | 20 class TextureManager; |
| 20 | 21 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 39 private: | 40 private: |
| 40 scoped_ptr<PrioritizedResource> texture_; | 41 scoped_ptr<PrioritizedResource> texture_; |
| 41 | 42 |
| 42 DISALLOW_COPY_AND_ASSIGN(Resource); | 43 DISALLOW_COPY_AND_ASSIGN(Resource); |
| 43 }; | 44 }; |
| 44 | 45 |
| 45 LayerUpdater() {} | 46 LayerUpdater() {} |
| 46 | 47 |
| 47 virtual scoped_ptr<Resource> CreateResource( | 48 virtual scoped_ptr<Resource> CreateResource( |
| 48 PrioritizedResourceManager* manager) = 0; | 49 PrioritizedResourceManager* manager) = 0; |
| 49 virtual void PrepareToUpdate(const gfx::Rect& content_rect, | 50 virtual void PrepareToUpdate(const gfx::Size& content_size, |
| 51 const gfx::Rect& paint_rect, |
| 50 const gfx::Size& tile_size, | 52 const gfx::Size& tile_size, |
| 51 float contents_width_scale, | 53 float contents_width_scale, |
| 52 float contents_height_scale) {} | 54 float contents_height_scale) {} |
| 53 virtual void ReduceMemoryUsage() {} | 55 virtual void ReduceMemoryUsage() {} |
| 54 | 56 |
| 55 // Set true by the layer when it is known that the entire output is going to | 57 // Set true by the layer when it is known that the entire output is going to |
| 56 // be opaque. | 58 // be opaque. |
| 57 virtual void SetOpaque(bool opaque) {} | 59 virtual void SetOpaque(bool opaque) {} |
| 58 // Set true by the layer when it is known that the entire output bounds will | 60 // Set true by the layer when it is known that the entire output bounds will |
| 59 // be rasterized. | 61 // be rasterized. |
| 60 virtual void SetFillsBoundsCompletely(bool fills_bounds) {} | 62 virtual void SetFillsBoundsCompletely(bool fills_bounds) {} |
| 63 virtual void SetBackgroundColor(SkColor background_color) {} |
| 61 | 64 |
| 62 protected: | 65 protected: |
| 63 virtual ~LayerUpdater() {} | 66 virtual ~LayerUpdater() {} |
| 64 | 67 |
| 65 private: | 68 private: |
| 66 friend class base::RefCounted<LayerUpdater>; | 69 friend class base::RefCounted<LayerUpdater>; |
| 67 | 70 |
| 68 DISALLOW_COPY_AND_ASSIGN(LayerUpdater); | 71 DISALLOW_COPY_AND_ASSIGN(LayerUpdater); |
| 69 }; | 72 }; |
| 70 | 73 |
| 71 } // namespace cc | 74 } // namespace cc |
| 72 | 75 |
| 73 #endif // CC_RESOURCES_LAYER_UPDATER_H_ | 76 #endif // CC_RESOURCES_LAYER_UPDATER_H_ |
| OLD | NEW |