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_BITMAP_CONTENT_LAYER_UPDATER_H_ | 5 #ifndef CC_RESOURCES_BITMAP_CONTENT_LAYER_UPDATER_H_ |
6 #define CC_RESOURCES_BITMAP_CONTENT_LAYER_UPDATER_H_ | 6 #define CC_RESOURCES_BITMAP_CONTENT_LAYER_UPDATER_H_ |
7 | 7 |
8 #include "cc/base/cc_export.h" | 8 #include "cc/base/cc_export.h" |
9 #include "cc/resources/content_layer_updater.h" | 9 #include "cc/resources/content_layer_updater.h" |
10 #include "skia/ext/refptr.h" | 10 #include "skia/ext/refptr.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 public: | 23 public: |
24 class Resource : public LayerUpdater::Resource { | 24 class Resource : public LayerUpdater::Resource { |
25 public: | 25 public: |
26 Resource(BitmapContentLayerUpdater* updater, | 26 Resource(BitmapContentLayerUpdater* updater, |
27 scoped_ptr<PrioritizedResource> resource); | 27 scoped_ptr<PrioritizedResource> resource); |
28 virtual ~Resource(); | 28 virtual ~Resource(); |
29 | 29 |
30 virtual void Update(ResourceUpdateQueue* queue, | 30 virtual void Update(ResourceUpdateQueue* queue, |
31 gfx::Rect source_rect, | 31 gfx::Rect source_rect, |
32 gfx::Vector2d dest_offset, | 32 gfx::Vector2d dest_offset, |
33 bool partial_update, | 33 bool partial_update) OVERRIDE; |
34 RenderingStats* stats) OVERRIDE; | |
35 | 34 |
36 private: | 35 private: |
37 BitmapContentLayerUpdater* updater_; | 36 BitmapContentLayerUpdater* updater_; |
38 | 37 |
39 DISALLOW_COPY_AND_ASSIGN(Resource); | 38 DISALLOW_COPY_AND_ASSIGN(Resource); |
40 }; | 39 }; |
41 | 40 |
42 static scoped_refptr<BitmapContentLayerUpdater> Create( | 41 static scoped_refptr<BitmapContentLayerUpdater> Create( |
43 scoped_ptr<LayerPainter> painter, | 42 scoped_ptr<LayerPainter> painter, |
44 RenderingStatsInstrumentation* stats_instrumenation, | 43 RenderingStatsInstrumentation* stats_instrumenation, |
45 int layer_id); | 44 int layer_id); |
46 | 45 |
47 virtual scoped_ptr<LayerUpdater::Resource> CreateResource( | 46 virtual scoped_ptr<LayerUpdater::Resource> CreateResource( |
48 PrioritizedResourceManager* manager) OVERRIDE; | 47 PrioritizedResourceManager* manager) OVERRIDE; |
49 virtual void PrepareToUpdate(gfx::Rect content_rect, | 48 virtual void PrepareToUpdate(gfx::Rect content_rect, |
50 gfx::Size tile_size, | 49 gfx::Size tile_size, |
51 float contents_width_scale, | 50 float contents_width_scale, |
52 float contents_height_scale, | 51 float contents_height_scale, |
53 gfx::Rect* resulting_opaque_rect, | 52 gfx::Rect* resulting_opaque_rect) OVERRIDE; |
54 RenderingStats* stats) OVERRIDE; | |
55 void UpdateTexture(ResourceUpdateQueue* queue, | 53 void UpdateTexture(ResourceUpdateQueue* queue, |
56 PrioritizedResource* resource, | 54 PrioritizedResource* resource, |
57 gfx::Rect source_rect, | 55 gfx::Rect source_rect, |
58 gfx::Vector2d dest_offset, | 56 gfx::Vector2d dest_offset, |
59 bool partial_update); | 57 bool partial_update); |
60 virtual void SetOpaque(bool opaque) OVERRIDE; | 58 virtual void SetOpaque(bool opaque) OVERRIDE; |
61 virtual void ReduceMemoryUsage() OVERRIDE; | 59 virtual void ReduceMemoryUsage() OVERRIDE; |
62 | 60 |
63 protected: | 61 protected: |
64 BitmapContentLayerUpdater( | 62 BitmapContentLayerUpdater( |
65 scoped_ptr<LayerPainter> painter, | 63 scoped_ptr<LayerPainter> painter, |
66 RenderingStatsInstrumentation* stats_instrumenation, | 64 RenderingStatsInstrumentation* stats_instrumenation, |
67 int layer_id); | 65 int layer_id); |
68 virtual ~BitmapContentLayerUpdater(); | 66 virtual ~BitmapContentLayerUpdater(); |
69 | 67 |
70 skia::RefPtr<SkCanvas> canvas_; | 68 skia::RefPtr<SkCanvas> canvas_; |
71 gfx::Size canvas_size_; | 69 gfx::Size canvas_size_; |
72 bool opaque_; | 70 bool opaque_; |
73 | 71 |
| 72 private: |
74 DISALLOW_COPY_AND_ASSIGN(BitmapContentLayerUpdater); | 73 DISALLOW_COPY_AND_ASSIGN(BitmapContentLayerUpdater); |
75 }; | 74 }; |
76 | 75 |
77 } // namespace cc | 76 } // namespace cc |
78 | 77 |
79 #endif // CC_RESOURCES_BITMAP_CONTENT_LAYER_UPDATER_H_ | 78 #endif // CC_RESOURCES_BITMAP_CONTENT_LAYER_UPDATER_H_ |
OLD | NEW |