OLD | NEW |
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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 ContentLayerChromium_h | 5 #ifndef ContentLayerChromium_h |
6 #define ContentLayerChromium_h | 6 #define ContentLayerChromium_h |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "cc/layer_painter.h" | 9 #include "cc/layer_painter.h" |
10 #include "cc/tiled_layer.h" | 10 #include "cc/tiled_layer.h" |
11 | 11 |
12 class SkCanvas; | 12 class SkCanvas; |
13 | 13 |
14 namespace cc { | 14 namespace cc { |
15 | 15 |
16 class ContentLayerChromiumClient; | 16 class ContentLayerClient; |
17 class FloatRect; | 17 class FloatRect; |
18 class IntRect; | 18 class IntRect; |
19 class LayerTextureUpdater; | 19 class LayerTextureUpdater; |
20 | 20 |
21 class ContentLayerPainter : public LayerPainterChromium { | 21 class ContentLayerPainter : public LayerPainter { |
22 public: | 22 public: |
23 static scoped_ptr<ContentLayerPainter> create(ContentLayerChromiumClient*); | 23 static scoped_ptr<ContentLayerPainter> create(ContentLayerClient*); |
24 | 24 |
25 virtual void paint(SkCanvas*, const IntRect& contentRect, FloatRect& opaque)
OVERRIDE; | 25 virtual void paint(SkCanvas*, const IntRect& contentRect, FloatRect& opaque)
OVERRIDE; |
26 | 26 |
27 private: | 27 private: |
28 explicit ContentLayerPainter(ContentLayerChromiumClient*); | 28 explicit ContentLayerPainter(ContentLayerClient*); |
29 | 29 |
30 ContentLayerChromiumClient* m_client; | 30 ContentLayerClient* m_client; |
31 | 31 |
32 DISALLOW_COPY_AND_ASSIGN(ContentLayerPainter); | 32 DISALLOW_COPY_AND_ASSIGN(ContentLayerPainter); |
33 }; | 33 }; |
34 | 34 |
35 // A layer that renders its contents into an SkCanvas. | 35 // A layer that renders its contents into an SkCanvas. |
36 class ContentLayerChromium : public TiledLayerChromium { | 36 class ContentLayer : public TiledLayer { |
37 public: | 37 public: |
38 static scoped_refptr<ContentLayerChromium> create(ContentLayerChromiumClient
*); | 38 static scoped_refptr<ContentLayer> create(ContentLayerClient*); |
39 | 39 |
40 void clearClient() { m_client = 0; } | 40 void clearClient() { m_client = 0; } |
41 | 41 |
42 virtual bool drawsContent() const OVERRIDE; | 42 virtual bool drawsContent() const OVERRIDE; |
43 virtual void setTexturePriorities(const CCPriorityCalculator&) OVERRIDE; | 43 virtual void setTexturePriorities(const PriorityCalculator&) OVERRIDE; |
44 virtual void update(CCTextureUpdateQueue&, const CCOcclusionTracker*, CCRend
eringStats&) OVERRIDE; | 44 virtual void update(TextureUpdateQueue&, const OcclusionTracker*, RenderingS
tats&) OVERRIDE; |
45 virtual bool needMoreUpdates() OVERRIDE; | 45 virtual bool needMoreUpdates() OVERRIDE; |
46 | 46 |
47 virtual void setContentsOpaque(bool) OVERRIDE; | 47 virtual void setContentsOpaque(bool) OVERRIDE; |
48 | 48 |
49 protected: | 49 protected: |
50 explicit ContentLayerChromium(ContentLayerChromiumClient*); | 50 explicit ContentLayer(ContentLayerClient*); |
51 virtual ~ContentLayerChromium(); | 51 virtual ~ContentLayer(); |
52 | 52 |
53 private: | 53 private: |
54 virtual LayerTextureUpdater* textureUpdater() const OVERRIDE; | 54 virtual LayerTextureUpdater* textureUpdater() const OVERRIDE; |
55 virtual void createTextureUpdaterIfNeeded() OVERRIDE; | 55 virtual void createTextureUpdaterIfNeeded() OVERRIDE; |
56 | 56 |
57 ContentLayerChromiumClient* m_client; | 57 ContentLayerClient* m_client; |
58 scoped_refptr<LayerTextureUpdater> m_textureUpdater; | 58 scoped_refptr<LayerTextureUpdater> m_textureUpdater; |
59 }; | 59 }; |
60 | 60 |
61 } | 61 } |
62 #endif | 62 #endif |
OLD | NEW |