Remove extra line from unit_tests.isolate
[chromium-blink-merge.git] / cc / BitmapCanvasLayerTextureUpdater.h
blob8cf4e2539b5ec1ba64c51ccd87f0edc960cd83f5
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
3 // found in the LICENSE file.
6 #ifndef BitmapCanvasLayerTextureUpdater_h
7 #define BitmapCanvasLayerTextureUpdater_h
9 #if USE(ACCELERATED_COMPOSITING)
11 #include "CanvasLayerTextureUpdater.h"
13 class SkCanvas;
15 namespace cc {
17 class LayerPainterChromium;
19 // This class rasterizes the contentRect into a skia bitmap canvas. It then updates
20 // textures by copying from the canvas into the texture, using MapSubImage if
21 // possible.
22 class BitmapCanvasLayerTextureUpdater : public CanvasLayerTextureUpdater {
23 public:
24 class Texture : public LayerTextureUpdater::Texture {
25 public:
26 Texture(BitmapCanvasLayerTextureUpdater*, scoped_ptr<CCPrioritizedTexture>);
27 virtual ~Texture();
29 virtual void updateRect(CCResourceProvider*, const IntRect& sourceRect, const IntSize& destOffset) OVERRIDE;
31 private:
32 BitmapCanvasLayerTextureUpdater* textureUpdater() { return m_textureUpdater; }
34 BitmapCanvasLayerTextureUpdater* m_textureUpdater;
37 static PassRefPtr<BitmapCanvasLayerTextureUpdater> create(PassOwnPtr<LayerPainterChromium>);
38 virtual ~BitmapCanvasLayerTextureUpdater();
40 virtual PassOwnPtr<LayerTextureUpdater::Texture> createTexture(CCPrioritizedTextureManager*) OVERRIDE;
41 virtual SampledTexelFormat sampledTexelFormat(GC3Denum textureFormat) OVERRIDE;
42 virtual void prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, CCRenderingStats&) OVERRIDE;
43 void updateTextureRect(CCResourceProvider*, CCPrioritizedTexture*, const IntRect& sourceRect, const IntSize& destOffset);
45 virtual void setOpaque(bool) OVERRIDE;
47 protected:
48 explicit BitmapCanvasLayerTextureUpdater(PassOwnPtr<LayerPainterChromium>);
50 OwnPtr<SkCanvas> m_canvas;
51 IntSize m_canvasSize;
52 bool m_opaque;
55 } // namespace cc
56 #endif // USE(ACCELERATED_COMPOSITING)
57 #endif // BitmapCanvasLayerTextureUpdater_h