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 BitmapSkPictureCanvasLayerTextureUpdater_h | 5 #ifndef BitmapSkPictureCanvasLayerTextureUpdater_h |
6 #define BitmapSkPictureCanvasLayerTextureUpdater_h | 6 #define BitmapSkPictureCanvasLayerTextureUpdater_h |
7 | 7 |
8 #include "cc/skpicture_canvas_layer_texture_updater.h" | 8 #include "cc/skpicture_canvas_layer_texture_updater.h" |
9 #include "third_party/skia/include/core/SkBitmap.h" | 9 #include "third_party/skia/include/core/SkBitmap.h" |
10 | 10 |
11 namespace cc { | 11 namespace cc { |
12 | 12 |
13 // This class records the contentRect into an SkPicture, then software rasterize
s | 13 // This class records the contentRect into an SkPicture, then software rasterize
s |
14 // the SkPicture into bitmaps for each tile. This implements CCSettings::perTile
Painting. | 14 // the SkPicture into bitmaps for each tile. This implements Settings::perTilePa
inting. |
15 class BitmapSkPictureCanvasLayerTextureUpdater : public SkPictureCanvasLayerText
ureUpdater { | 15 class BitmapSkPictureCanvasLayerTextureUpdater : public SkPictureCanvasLayerText
ureUpdater { |
16 public: | 16 public: |
17 class Texture : public CanvasLayerTextureUpdater::Texture { | 17 class Texture : public CanvasLayerTextureUpdater::Texture { |
18 public: | 18 public: |
19 Texture(BitmapSkPictureCanvasLayerTextureUpdater*, scoped_ptr<CCPrioriti
zedTexture>); | 19 Texture(BitmapSkPictureCanvasLayerTextureUpdater*, scoped_ptr<Prioritize
dTexture>); |
20 | 20 |
21 virtual void update(CCTextureUpdateQueue&, const IntRect& sourceRect, co
nst IntSize& destOffset, bool partialUpdate, CCRenderingStats&) OVERRIDE; | 21 virtual void update(TextureUpdateQueue&, const IntRect& sourceRect, cons
t IntSize& destOffset, bool partialUpdate, RenderingStats&) OVERRIDE; |
22 | 22 |
23 private: | 23 private: |
24 BitmapSkPictureCanvasLayerTextureUpdater* textureUpdater() { return m_te
xtureUpdater; } | 24 BitmapSkPictureCanvasLayerTextureUpdater* textureUpdater() { return m_te
xtureUpdater; } |
25 | 25 |
26 SkBitmap m_bitmap; | 26 SkBitmap m_bitmap; |
27 BitmapSkPictureCanvasLayerTextureUpdater* m_textureUpdater; | 27 BitmapSkPictureCanvasLayerTextureUpdater* m_textureUpdater; |
28 }; | 28 }; |
29 | 29 |
30 static scoped_refptr<BitmapSkPictureCanvasLayerTextureUpdater> create(scoped
_ptr<LayerPainterChromium>); | 30 static scoped_refptr<BitmapSkPictureCanvasLayerTextureUpdater> create(scoped
_ptr<LayerPainter>); |
31 | 31 |
32 virtual scoped_ptr<LayerTextureUpdater::Texture> createTexture(CCPrioritized
TextureManager*) OVERRIDE; | 32 virtual scoped_ptr<LayerTextureUpdater::Texture> createTexture(PrioritizedTe
xtureManager*) OVERRIDE; |
33 virtual SampledTexelFormat sampledTexelFormat(GC3Denum textureFormat) OVERRI
DE; | 33 virtual SampledTexelFormat sampledTexelFormat(GC3Denum textureFormat) OVERRI
DE; |
34 void paintContentsRect(SkCanvas*, const IntRect& sourceRect, CCRenderingStat
s&); | 34 void paintContentsRect(SkCanvas*, const IntRect& sourceRect, RenderingStats&
); |
35 | 35 |
36 private: | 36 private: |
37 explicit BitmapSkPictureCanvasLayerTextureUpdater(scoped_ptr<LayerPainterChr
omium>); | 37 explicit BitmapSkPictureCanvasLayerTextureUpdater(scoped_ptr<LayerPainter>); |
38 virtual ~BitmapSkPictureCanvasLayerTextureUpdater(); | 38 virtual ~BitmapSkPictureCanvasLayerTextureUpdater(); |
39 }; | 39 }; |
40 | 40 |
41 } // namespace cc | 41 } // namespace cc |
42 | 42 |
43 #endif // BitmapSkPictureCanvasLayerTextureUpdater_h | 43 #endif // BitmapSkPictureCanvasLayerTextureUpdater_h |
OLD | NEW |