| OLD | NEW |
| 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 "CCPrioritizedTexture.h" |
| 9 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 10 #include "CCPrioritizedTexture.h" | 11 #include "third_party/khronos/GLES2/gl2.h" |
| 11 #include "GraphicsTypes3D.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 base::RefCounted<LayerTextureUpdater> { | 21 class LayerTextureUpdater : public base::RefCounted<LayerTextureUpdater> { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 42 enum SampledTexelFormat { | 42 enum SampledTexelFormat { |
| 43 SampledTexelFormatRGBA, | 43 SampledTexelFormatRGBA, |
| 44 SampledTexelFormatBGRA, | 44 SampledTexelFormatBGRA, |
| 45 SampledTexelFormatInvalid, | 45 SampledTexelFormatInvalid, |
| 46 }; | 46 }; |
| 47 virtual scoped_ptr<Texture> createTexture(CCPrioritizedTextureManager*) = 0; | 47 virtual scoped_ptr<Texture> createTexture(CCPrioritizedTextureManager*) = 0; |
| 48 // Returns the format of the texel uploaded by this interface. | 48 // Returns the format of the texel uploaded by this interface. |
| 49 // This format should not be confused by texture internal format. | 49 // This format should not be confused by texture internal format. |
| 50 // This format specifies the component order in the sampled texel. | 50 // This format specifies the component order in the sampled texel. |
| 51 // 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. |
| 52 virtual SampledTexelFormat sampledTexelFormat(GC3Denum textureFormat) = 0; | 52 virtual SampledTexelFormat sampledTexelFormat(GLenum textureFormat) = 0; |
| 53 // 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, |
| 54 // 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. |
| 55 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&) { } |
| 56 | 56 |
| 57 // 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. |
| 58 virtual void setOpaque(bool) { } | 58 virtual void setOpaque(bool) { } |
| 59 | 59 |
| 60 protected: | 60 protected: |
| 61 virtual ~LayerTextureUpdater() { } | 61 virtual ~LayerTextureUpdater() { } |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 friend class base::RefCounted<LayerTextureUpdater>; | 64 friend class base::RefCounted<LayerTextureUpdater>; |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 } // namespace cc | 67 } // namespace cc |
| 68 #endif // LayerTextureUpdater_h | 68 #endif // LayerTextureUpdater_h |
| OLD | NEW |