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 14 matching lines...) Expand all Loading... |
25 public: | 25 public: |
26 class Resource : public LayerUpdater::Resource { | 26 class Resource : public LayerUpdater::Resource { |
27 public: | 27 public: |
28 Resource(BitmapContentLayerUpdater* updater, | 28 Resource(BitmapContentLayerUpdater* updater, |
29 scoped_ptr<PrioritizedResource> resource); | 29 scoped_ptr<PrioritizedResource> resource); |
30 virtual ~Resource(); | 30 virtual ~Resource(); |
31 | 31 |
32 virtual void Update(ResourceUpdateQueue* queue, | 32 virtual void Update(ResourceUpdateQueue* queue, |
33 const gfx::Rect& source_rect, | 33 const gfx::Rect& source_rect, |
34 const gfx::Vector2d& dest_offset, | 34 const gfx::Vector2d& dest_offset, |
35 bool partial_update) OVERRIDE; | 35 bool partial_update) override; |
36 | 36 |
37 private: | 37 private: |
38 BitmapContentLayerUpdater* updater_; | 38 BitmapContentLayerUpdater* updater_; |
39 | 39 |
40 DISALLOW_COPY_AND_ASSIGN(Resource); | 40 DISALLOW_COPY_AND_ASSIGN(Resource); |
41 }; | 41 }; |
42 | 42 |
43 static scoped_refptr<BitmapContentLayerUpdater> Create( | 43 static scoped_refptr<BitmapContentLayerUpdater> Create( |
44 scoped_ptr<LayerPainter> painter, | 44 scoped_ptr<LayerPainter> painter, |
45 RenderingStatsInstrumentation* stats_instrumenation, | 45 RenderingStatsInstrumentation* stats_instrumenation, |
46 int layer_id); | 46 int layer_id); |
47 | 47 |
48 virtual scoped_ptr<LayerUpdater::Resource> CreateResource( | 48 virtual scoped_ptr<LayerUpdater::Resource> CreateResource( |
49 PrioritizedResourceManager* manager) OVERRIDE; | 49 PrioritizedResourceManager* manager) override; |
50 virtual void PrepareToUpdate(const gfx::Size& content_size, | 50 virtual void PrepareToUpdate(const gfx::Size& content_size, |
51 const gfx::Rect& paint_rect, | 51 const gfx::Rect& paint_rect, |
52 const gfx::Size& tile_size, | 52 const gfx::Size& tile_size, |
53 float contents_width_scale, | 53 float contents_width_scale, |
54 float contents_height_scale) OVERRIDE; | 54 float contents_height_scale) override; |
55 void UpdateTexture(ResourceUpdateQueue* queue, | 55 void UpdateTexture(ResourceUpdateQueue* queue, |
56 PrioritizedResource* resource, | 56 PrioritizedResource* resource, |
57 const gfx::Rect& source_rect, | 57 const gfx::Rect& source_rect, |
58 const gfx::Vector2d& dest_offset, | 58 const gfx::Vector2d& dest_offset, |
59 bool partial_update); | 59 bool partial_update); |
60 virtual void SetOpaque(bool opaque) OVERRIDE; | 60 virtual void SetOpaque(bool opaque) override; |
61 virtual void ReduceMemoryUsage() OVERRIDE; | 61 virtual void ReduceMemoryUsage() override; |
62 | 62 |
63 protected: | 63 protected: |
64 BitmapContentLayerUpdater( | 64 BitmapContentLayerUpdater( |
65 scoped_ptr<LayerPainter> painter, | 65 scoped_ptr<LayerPainter> painter, |
66 RenderingStatsInstrumentation* stats_instrumenation, | 66 RenderingStatsInstrumentation* stats_instrumenation, |
67 int layer_id); | 67 int layer_id); |
68 virtual ~BitmapContentLayerUpdater(); | 68 virtual ~BitmapContentLayerUpdater(); |
69 | 69 |
70 SkBitmap bitmap_backing_; | 70 SkBitmap bitmap_backing_; |
71 skia::RefPtr<SkCanvas> canvas_; | 71 skia::RefPtr<SkCanvas> canvas_; |
72 gfx::Size canvas_size_; | 72 gfx::Size canvas_size_; |
73 | 73 |
74 private: | 74 private: |
75 DISALLOW_COPY_AND_ASSIGN(BitmapContentLayerUpdater); | 75 DISALLOW_COPY_AND_ASSIGN(BitmapContentLayerUpdater); |
76 }; | 76 }; |
77 | 77 |
78 } // namespace cc | 78 } // namespace cc |
79 | 79 |
80 #endif // CC_RESOURCES_BITMAP_CONTENT_LAYER_UPDATER_H_ | 80 #endif // CC_RESOURCES_BITMAP_CONTENT_LAYER_UPDATER_H_ |
OLD | NEW |