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

Side by Side Diff: cc/layer_texture_updater.h

Issue 11143027: cc: Remove wtf includes from *LayerTextureUpdater headers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Out of line CBCLTU dtor Created 8 years, 2 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 | « cc/image_layer.cc ('k') | cc/scrollbar_layer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 LayerTextureUpdater_h 6 #ifndef LayerTextureUpdater_h
7 #define LayerTextureUpdater_h 7 #define LayerTextureUpdater_h
8 8
9 #include "base/memory/ref_counted.h"
9 #include "CCPrioritizedTexture.h" 10 #include "CCPrioritizedTexture.h"
10 #include "GraphicsTypes3D.h" 11 #include "GraphicsTypes3D.h"
11 #include <wtf/RefCounted.h>
12 12
13 namespace cc { 13 namespace cc {
14 14
15 class IntRect; 15 class IntRect;
16 class IntSize; 16 class IntSize;
17 class TextureManager; 17 class TextureManager;
18 struct CCRenderingStats; 18 struct CCRenderingStats;
19 class CCTextureUpdateQueue; 19 class CCTextureUpdateQueue;
20 20
21 class LayerTextureUpdater : public RefCounted<LayerTextureUpdater> { 21 class LayerTextureUpdater : public base::RefCounted<LayerTextureUpdater> {
22 public: 22 public:
23 // Allows texture uploaders to store per-tile resources. 23 // Allows texture uploaders to store per-tile resources.
24 class Texture { 24 class Texture {
25 public: 25 public:
26 virtual ~Texture(); 26 virtual ~Texture();
27 27
28 CCPrioritizedTexture* texture() { return m_texture.get(); } 28 CCPrioritizedTexture* texture() { return m_texture.get(); }
29 void swapTextureWith(scoped_ptr<CCPrioritizedTexture>& texture) { m_text ure.swap(texture); } 29 void swapTextureWith(scoped_ptr<CCPrioritizedTexture>& texture) { m_text ure.swap(texture); }
30 // TODO(reveman): partialUpdate should be a property of this class 30 // TODO(reveman): partialUpdate should be a property of this class
31 // instead of an argument passed to update(). 31 // instead of an argument passed to update().
32 virtual void update(CCTextureUpdateQueue&, const IntRect& sourceRect, co nst IntSize& destOffset, bool partialUpdate, CCRenderingStats&) = 0; 32 virtual void update(CCTextureUpdateQueue&, const IntRect& sourceRect, co nst IntSize& destOffset, bool partialUpdate, CCRenderingStats&) = 0;
33 protected: 33 protected:
34 explicit Texture(scoped_ptr<CCPrioritizedTexture> texture); 34 explicit Texture(scoped_ptr<CCPrioritizedTexture> texture);
35 35
36 private: 36 private:
37 scoped_ptr<CCPrioritizedTexture> m_texture; 37 scoped_ptr<CCPrioritizedTexture> m_texture;
38 }; 38 };
39 39
40 LayerTextureUpdater() 40 LayerTextureUpdater() { }
41 {
42 turnOffVerifier(); // In the component build we don't have WTF threading initialized in this DLL so the thread verifier explodes.
43 }
44
45 virtual ~LayerTextureUpdater() { }
46 41
47 enum SampledTexelFormat { 42 enum SampledTexelFormat {
48 SampledTexelFormatRGBA, 43 SampledTexelFormatRGBA,
49 SampledTexelFormatBGRA, 44 SampledTexelFormatBGRA,
50 SampledTexelFormatInvalid, 45 SampledTexelFormatInvalid,
51 }; 46 };
52 virtual PassOwnPtr<Texture> createTexture(CCPrioritizedTextureManager*) = 0; 47 virtual scoped_ptr<Texture> createTexture(CCPrioritizedTextureManager*) = 0;
53 // Returns the format of the texel uploaded by this interface. 48 // Returns the format of the texel uploaded by this interface.
54 // This format should not be confused by texture internal format. 49 // This format should not be confused by texture internal format.
55 // This format specifies the component order in the sampled texel. 50 // This format specifies the component order in the sampled texel.
56 // If the format is TexelFormatBGRA, vec4.x is blue and vec4.z is red. 51 // If the format is TexelFormatBGRA, vec4.x is blue and vec4.z is red.
57 virtual SampledTexelFormat sampledTexelFormat(GC3Denum textureFormat) = 0; 52 virtual SampledTexelFormat sampledTexelFormat(GC3Denum textureFormat) = 0;
58 // The |resultingOpaqueRect| gives back a region of the layer that was paint ed opaque. If the layer is marked opaque in the updater, 53 // The |resultingOpaqueRect| gives back a region of the layer that was paint ed opaque. If the layer is marked opaque in the updater,
59 // then this region should be ignored in preference for the entire layer's a rea. 54 // then this region should be ignored in preference for the entire layer's a rea.
60 virtual void prepareToUpdate(const IntRect& contentRect, const IntSize& tile Size, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpa queRect, CCRenderingStats&) { } 55 virtual void prepareToUpdate(const IntRect& contentRect, const IntSize& tile Size, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpa queRect, CCRenderingStats&) { }
61 56
62 // Set true by the layer when it is known that the entire output is going to be opaque. 57 // Set true by the layer when it is known that the entire output is going to be opaque.
63 virtual void setOpaque(bool) { } 58 virtual void setOpaque(bool) { }
59
60 protected:
61 virtual ~LayerTextureUpdater() { }
62
63 private:
64 friend class base::RefCounted<LayerTextureUpdater>;
64 }; 65 };
65 66
66 } // namespace cc 67 } // namespace cc
67 #endif // LayerTextureUpdater_h 68 #endif // LayerTextureUpdater_h
OLDNEW
« no previous file with comments | « cc/image_layer.cc ('k') | cc/scrollbar_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698