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" |
11 #include "third_party/skia/include/core/SkBitmap.h" | 11 #include "third_party/skia/include/core/SkBitmap.h" |
12 | 12 |
13 class SkCanvas; | 13 class SkCanvas; |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 | 16 |
17 class LayerPainter; | 17 class LayerPainter; |
18 class RenderingStatsInstrumenation; | 18 class RenderingStatsInstrumenation; |
19 | 19 |
20 // This class rasterizes the content_rect into a skia bitmap canvas. It then | 20 // This class rasterizes the content_rect into a skia bitmap canvas. It then |
21 // updates textures by copying from the canvas into the texture, using | 21 // creates a ResourceUpdate with this bitmap canvas and inserts the |
22 // MapSubImage if possible. | 22 // ResourceBundle to the provided ResourceUpdateQueue. Actual texture uploading |
| 23 // is done by ResourceUpdateController. |
23 class CC_EXPORT BitmapContentLayerUpdater : public ContentLayerUpdater { | 24 class CC_EXPORT BitmapContentLayerUpdater : public ContentLayerUpdater { |
24 public: | 25 public: |
25 class Resource : public LayerUpdater::Resource { | 26 class Resource : public LayerUpdater::Resource { |
26 public: | 27 public: |
27 Resource(BitmapContentLayerUpdater* updater, | 28 Resource(BitmapContentLayerUpdater* updater, |
28 scoped_ptr<PrioritizedResource> resource); | 29 scoped_ptr<PrioritizedResource> resource); |
29 virtual ~Resource(); | 30 virtual ~Resource(); |
30 | 31 |
31 virtual void Update(ResourceUpdateQueue* queue, | 32 virtual void Update(ResourceUpdateQueue* queue, |
32 gfx::Rect source_rect, | 33 gfx::Rect source_rect, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 gfx::Size canvas_size_; | 72 gfx::Size canvas_size_; |
72 bool opaque_; | 73 bool opaque_; |
73 | 74 |
74 private: | 75 private: |
75 DISALLOW_COPY_AND_ASSIGN(BitmapContentLayerUpdater); | 76 DISALLOW_COPY_AND_ASSIGN(BitmapContentLayerUpdater); |
76 }; | 77 }; |
77 | 78 |
78 } // namespace cc | 79 } // namespace cc |
79 | 80 |
80 #endif // CC_RESOURCES_BITMAP_CONTENT_LAYER_UPDATER_H_ | 81 #endif // CC_RESOURCES_BITMAP_CONTENT_LAYER_UPDATER_H_ |
OLD | NEW |