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