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 | 5 |
6 #ifndef FrameBufferSkPictureCanvasLayerTextureUpdater_h | 6 #ifndef FrameBufferSkPictureCanvasLayerTextureUpdater_h |
7 #define FrameBufferSkPictureCanvasLayerTextureUpdater_h | 7 #define FrameBufferSkPictureCanvasLayerTextureUpdater_h |
8 | 8 |
9 #if USE(ACCELERATED_COMPOSITING) | 9 #if USE(ACCELERATED_COMPOSITING) |
10 | 10 |
11 #include "SkPictureCanvasLayerTextureUpdater.h" | 11 #include "SkPictureCanvasLayerTextureUpdater.h" |
12 | 12 |
13 class GrContext; | 13 class GrContext; |
14 | 14 |
15 namespace WebKit { | 15 namespace WebKit { |
16 class WebGraphicsContext3D; | 16 class WebGraphicsContext3D; |
17 class WebSharedGraphicsContext3D; | 17 class WebSharedGraphicsContext3D; |
18 } | 18 } |
19 | 19 |
20 namespace WebCore { | 20 namespace cc { |
21 | 21 |
22 // This class records the contentRect into an SkPicture, then uses accelerated | 22 // This class records the contentRect into an SkPicture, then uses accelerated |
23 // drawing to update the texture. The accelerated drawing goes to an | 23 // drawing to update the texture. The accelerated drawing goes to an |
24 // intermediate framebuffer and then is copied to the destination texture once d
one. | 24 // intermediate framebuffer and then is copied to the destination texture once d
one. |
25 class FrameBufferSkPictureCanvasLayerTextureUpdater : public SkPictureCanvasLaye
rTextureUpdater { | 25 class FrameBufferSkPictureCanvasLayerTextureUpdater : public SkPictureCanvasLaye
rTextureUpdater { |
26 public: | 26 public: |
27 class Texture : public LayerTextureUpdater::Texture { | 27 class Texture : public LayerTextureUpdater::Texture { |
28 public: | 28 public: |
29 Texture(FrameBufferSkPictureCanvasLayerTextureUpdater*, PassOwnPtr<CCPri
oritizedTexture>); | 29 Texture(FrameBufferSkPictureCanvasLayerTextureUpdater*, PassOwnPtr<CCPri
oritizedTexture>); |
30 virtual ~Texture(); | 30 virtual ~Texture(); |
31 | 31 |
32 virtual void updateRect(CCResourceProvider*, const IntRect& sourceRect,
const IntSize& destOffset) OVERRIDE; | 32 virtual void updateRect(CCResourceProvider*, const IntRect& sourceRect,
const IntSize& destOffset) OVERRIDE; |
33 | 33 |
34 private: | 34 private: |
35 FrameBufferSkPictureCanvasLayerTextureUpdater* textureUpdater() { return
m_textureUpdater; } | 35 FrameBufferSkPictureCanvasLayerTextureUpdater* textureUpdater() { return
m_textureUpdater; } |
36 | 36 |
37 FrameBufferSkPictureCanvasLayerTextureUpdater* m_textureUpdater; | 37 FrameBufferSkPictureCanvasLayerTextureUpdater* m_textureUpdater; |
38 }; | 38 }; |
39 | 39 |
40 static PassRefPtr<FrameBufferSkPictureCanvasLayerTextureUpdater> create(Pass
OwnPtr<LayerPainterChromium>); | 40 static PassRefPtr<FrameBufferSkPictureCanvasLayerTextureUpdater> create(Pass
OwnPtr<LayerPainterChromium>); |
41 virtual ~FrameBufferSkPictureCanvasLayerTextureUpdater(); | 41 virtual ~FrameBufferSkPictureCanvasLayerTextureUpdater(); |
42 | 42 |
43 virtual PassOwnPtr<LayerTextureUpdater::Texture> createTexture(CCPrioritized
TextureManager*) OVERRIDE; | 43 virtual PassOwnPtr<LayerTextureUpdater::Texture> createTexture(CCPrioritized
TextureManager*) OVERRIDE; |
44 virtual SampledTexelFormat sampledTexelFormat(GC3Denum textureFormat) OVERRI
DE; | 44 virtual SampledTexelFormat sampledTexelFormat(GC3Denum textureFormat) OVERRI
DE; |
45 void updateTextureRect(WebKit::WebGraphicsContext3D*, GrContext*, CCResource
Provider*, CCPrioritizedTexture*, const IntRect& sourceRect, const IntSize& dest
Offset); | 45 void updateTextureRect(WebKit::WebGraphicsContext3D*, GrContext*, CCResource
Provider*, CCPrioritizedTexture*, const IntRect& sourceRect, const IntSize& dest
Offset); |
46 | 46 |
47 private: | 47 private: |
48 explicit FrameBufferSkPictureCanvasLayerTextureUpdater(PassOwnPtr<LayerPaint
erChromium>); | 48 explicit FrameBufferSkPictureCanvasLayerTextureUpdater(PassOwnPtr<LayerPaint
erChromium>); |
49 }; | 49 }; |
50 } // namespace WebCore | 50 } // namespace cc |
51 #endif // USE(ACCELERATED_COMPOSITING) | 51 #endif // USE(ACCELERATED_COMPOSITING) |
52 #endif // FrameBufferSkPictureCanvasLayerTextureUpdater_h | 52 #endif // FrameBufferSkPictureCanvasLayerTextureUpdater_h |
OLD | NEW |