Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(562)

Side by Side Diff: ui/cc/BitmapCanvasLayerTextureUpdater.h

Issue 10701016: Initial import attempt, just to play with. Many things disabled/removed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/cc/BitmapCanvasLayerTextureUpdater.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26
27 #ifndef BitmapCanvasLayerTextureUpdater_h
28 #define BitmapCanvasLayerTextureUpdater_h
29
30 #if USE(ACCELERATED_COMPOSITING)
31
32 #include "CanvasLayerTextureUpdater.h"
33 #include "LayerTextureSubImage.h"
34
35 class SkCanvas;
36
37 namespace WebCore {
38
39 class LayerPainterChromium;
40
41 // This class rasterizes the contentRect into a skia bitmap canvas. It then upda tes
42 // textures by copying from the canvas into the texture, using MapSubImage if
43 // possible.
44 class BitmapCanvasLayerTextureUpdater : public CanvasLayerTextureUpdater {
45 public:
46 class Texture : public LayerTextureUpdater::Texture {
47 public:
48 Texture(BitmapCanvasLayerTextureUpdater*, PassOwnPtr<ManagedTexture>);
49 virtual ~Texture();
50
51 virtual void updateRect(CCGraphicsContext*, TextureAllocator*, const Int Rect& sourceRect, const IntRect& destRect) OVERRIDE;
52
53 private:
54 BitmapCanvasLayerTextureUpdater* textureUpdater() { return m_textureUpda ter; }
55
56 BitmapCanvasLayerTextureUpdater* m_textureUpdater;
57 };
58
59 static PassRefPtr<BitmapCanvasLayerTextureUpdater> create(PassOwnPtr<LayerPa interChromium>, bool useMapTexSubImage);
60 virtual ~BitmapCanvasLayerTextureUpdater();
61
62 virtual PassOwnPtr<LayerTextureUpdater::Texture> createTexture(TextureManage r*);
63 virtual SampledTexelFormat sampledTexelFormat(GC3Denum textureFormat);
64 virtual void prepareToUpdate(const IntRect& contentRect, const IntSize& tile Size, float contentsScale, IntRect& resultingOpaqueRect) OVERRIDE;
65 void updateTextureRect(CCGraphicsContext*, TextureAllocator*, ManagedTexture *, const IntRect& sourceRect, const IntRect& destRect);
66
67 virtual void setOpaque(bool) OVERRIDE;
68
69 private:
70 BitmapCanvasLayerTextureUpdater(PassOwnPtr<LayerPainterChromium>, bool useMa pTexSubImage);
71
72 OwnPtr<SkCanvas> m_canvas;
73 IntSize m_canvasSize;
74 bool m_opaque;
75 LayerTextureSubImage m_texSubImage;
76 };
77
78 } // namespace WebCore
79 #endif // USE(ACCELERATED_COMPOSITING)
80 #endif // BitmapCanvasLayerTextureUpdater_h
OLDNEW
« no previous file with comments | « no previous file | ui/cc/BitmapCanvasLayerTextureUpdater.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698