| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 CC_TEXTURE_LAYER_IMPL_H_ | 5 #ifndef CC_TEXTURE_LAYER_IMPL_H_ |
| 6 #define CC_TEXTURE_LAYER_IMPL_H_ | 6 #define CC_TEXTURE_LAYER_IMPL_H_ |
| 7 | 7 |
| 8 #include "cc/cc_export.h" | 8 #include "cc/cc_export.h" |
| 9 #include "cc/layer_impl.h" | 9 #include "cc/layer_impl.h" |
| 10 | 10 |
| 11 namespace cc { | 11 namespace cc { |
| 12 | 12 |
| 13 class CC_EXPORT TextureLayerImpl : public LayerImpl { | 13 class CC_EXPORT TextureLayerImpl : public LayerImpl { |
| 14 public: | 14 public: |
| 15 static scoped_ptr<TextureLayerImpl> create(int id) | 15 static scoped_ptr<TextureLayerImpl> create(LayerTreeHostImpl* hostImpl, int
id) |
| 16 { | 16 { |
| 17 return make_scoped_ptr(new TextureLayerImpl(id)); | 17 return make_scoped_ptr(new TextureLayerImpl(hostImpl, id)); |
| 18 } | 18 } |
| 19 virtual ~TextureLayerImpl(); | 19 virtual ~TextureLayerImpl(); |
| 20 | 20 |
| 21 virtual void willDraw(ResourceProvider*) OVERRIDE; | 21 virtual void willDraw(ResourceProvider*) OVERRIDE; |
| 22 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; | 22 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; |
| 23 virtual void didDraw(ResourceProvider*) OVERRIDE; | 23 virtual void didDraw(ResourceProvider*) OVERRIDE; |
| 24 | 24 |
| 25 virtual void didLoseOutputSurface() OVERRIDE; | 25 virtual void didLoseOutputSurface() OVERRIDE; |
| 26 | 26 |
| 27 virtual void dumpLayerProperties(std::string*, int indent) const OVERRIDE; | 27 virtual void dumpLayerProperties(std::string*, int indent) const OVERRIDE; |
| 28 | 28 |
| 29 unsigned textureId() const { return m_textureId; } | 29 unsigned textureId() const { return m_textureId; } |
| 30 void setTextureId(unsigned id) { m_textureId = id; } | 30 void setTextureId(unsigned id) { m_textureId = id; } |
| 31 void setPremultipliedAlpha(bool premultipliedAlpha) { m_premultipliedAlpha =
premultipliedAlpha; } | 31 void setPremultipliedAlpha(bool premultipliedAlpha) { m_premultipliedAlpha =
premultipliedAlpha; } |
| 32 void setFlipped(bool flipped) { m_flipped = flipped; } | 32 void setFlipped(bool flipped) { m_flipped = flipped; } |
| 33 void setUVRect(const gfx::RectF& rect) { m_uvRect = rect; } | 33 void setUVRect(const gfx::RectF& rect) { m_uvRect = rect; } |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 explicit TextureLayerImpl(int); | 36 TextureLayerImpl(LayerTreeHostImpl* hostImpl, int id); |
| 37 | 37 |
| 38 virtual const char* layerTypeAsString() const OVERRIDE; | 38 virtual const char* layerTypeAsString() const OVERRIDE; |
| 39 | 39 |
| 40 unsigned m_textureId; | 40 unsigned m_textureId; |
| 41 ResourceProvider::ResourceId m_externalTextureResource; | 41 ResourceProvider::ResourceId m_externalTextureResource; |
| 42 bool m_premultipliedAlpha; | 42 bool m_premultipliedAlpha; |
| 43 bool m_flipped; | 43 bool m_flipped; |
| 44 gfx::RectF m_uvRect; | 44 gfx::RectF m_uvRect; |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 } | 47 } |
| 48 | 48 |
| 49 #endif // CC_TEXTURE_LAYER_IMPL_H_ | 49 #endif // CC_TEXTURE_LAYER_IMPL_H_ |
| OLD | NEW |