| 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" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 private: | 39 private: |
| 40 scoped_ptr<PrioritizedResource> texture_; | 40 scoped_ptr<PrioritizedResource> texture_; |
| 41 | 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(Resource); | 42 DISALLOW_COPY_AND_ASSIGN(Resource); |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 LayerUpdater() {} | 45 LayerUpdater() {} |
| 46 | 46 |
| 47 virtual scoped_ptr<Resource> CreateResource( | 47 virtual scoped_ptr<Resource> CreateResource( |
| 48 PrioritizedResourceManager* manager) = 0; | 48 PrioritizedResourceManager* manager) = 0; |
| 49 // The |resulting_opaque_rect| gives back a region of the layer that was | |
| 50 // painted opaque. If the layer is marked opaque in the updater, then this | |
| 51 // region should be ignored in preference for the entire layer's area. | |
| 52 virtual void PrepareToUpdate(const gfx::Rect& content_rect, | 49 virtual void PrepareToUpdate(const gfx::Rect& content_rect, |
| 53 const gfx::Size& tile_size, | 50 const gfx::Size& tile_size, |
| 54 float contents_width_scale, | 51 float contents_width_scale, |
| 55 float contents_height_scale, | 52 float contents_height_scale) {} |
| 56 gfx::Rect* resulting_opaque_rect) {} | |
| 57 virtual void ReduceMemoryUsage() {} | 53 virtual void ReduceMemoryUsage() {} |
| 58 | 54 |
| 59 // Set true by the layer when it is known that the entire output is going to | 55 // Set true by the layer when it is known that the entire output is going to |
| 60 // be opaque. | 56 // be opaque. |
| 61 virtual void SetOpaque(bool opaque) {} | 57 virtual void SetOpaque(bool opaque) {} |
| 62 // Set true by the layer when it is known that the entire output bounds will | 58 // Set true by the layer when it is known that the entire output bounds will |
| 63 // be rasterized. | 59 // be rasterized. |
| 64 virtual void SetFillsBoundsCompletely(bool fills_bounds) {} | 60 virtual void SetFillsBoundsCompletely(bool fills_bounds) {} |
| 65 | 61 |
| 66 protected: | 62 protected: |
| 67 virtual ~LayerUpdater() {} | 63 virtual ~LayerUpdater() {} |
| 68 | 64 |
| 69 private: | 65 private: |
| 70 friend class base::RefCounted<LayerUpdater>; | 66 friend class base::RefCounted<LayerUpdater>; |
| 71 | 67 |
| 72 DISALLOW_COPY_AND_ASSIGN(LayerUpdater); | 68 DISALLOW_COPY_AND_ASSIGN(LayerUpdater); |
| 73 }; | 69 }; |
| 74 | 70 |
| 75 } // namespace cc | 71 } // namespace cc |
| 76 | 72 |
| 77 #endif // CC_RESOURCES_LAYER_UPDATER_H_ | 73 #endif // CC_RESOURCES_LAYER_UPDATER_H_ |
| OLD | NEW |