| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 virtual void didDraw(ResourceProvider*) OVERRIDE; | 26 virtual void didDraw(ResourceProvider*) OVERRIDE; |
| 27 | 27 |
| 28 virtual void didLoseOutputSurface() OVERRIDE; | 28 virtual void didLoseOutputSurface() OVERRIDE; |
| 29 | 29 |
| 30 virtual void dumpLayerProperties(std::string*, int indent) const OVERRIDE; | 30 virtual void dumpLayerProperties(std::string*, int indent) const OVERRIDE; |
| 31 | 31 |
| 32 unsigned textureId() const { return m_textureId; } | 32 unsigned textureId() const { return m_textureId; } |
| 33 void setTextureId(unsigned id) { m_textureId = id; } | 33 void setTextureId(unsigned id) { m_textureId = id; } |
| 34 void setPremultipliedAlpha(bool premultipliedAlpha) { m_premultipliedAlpha =
premultipliedAlpha; } | 34 void setPremultipliedAlpha(bool premultipliedAlpha) { m_premultipliedAlpha =
premultipliedAlpha; } |
| 35 void setFlipped(bool flipped) { m_flipped = flipped; } | 35 void setFlipped(bool flipped) { m_flipped = flipped; } |
| 36 void setUVRect(const gfx::RectF& rect) { m_uvRect = rect; } | 36 void setUVTopLeft(const gfx::PointF& topLeft) { m_uvTopLeft = topLeft; } |
| 37 void setUVBottomRight(const gfx::PointF& bottomRight) { m_uvBottomRight = bo
ttomRight; } |
| 37 | 38 |
| 38 // 1--2 | 39 // 1--2 |
| 39 // | | | 40 // | | |
| 40 // 0--3 | 41 // 0--3 |
| 41 void setVertexOpacity(const float vertexOpacity[4]); | 42 void setVertexOpacity(const float vertexOpacity[4]); |
| 42 | 43 |
| 43 void setTextureMailbox(const std::string& mailboxName, const base::Callback<
void(unsigned)>& releaseCallback); | 44 void setTextureMailbox(const std::string& mailboxName, const base::Callback<
void(unsigned)>& releaseCallback); |
| 44 | 45 |
| 45 private: | 46 private: |
| 46 TextureLayerImpl(LayerTreeImpl* treeImpl, int id, bool usesMailbox); | 47 TextureLayerImpl(LayerTreeImpl* treeImpl, int id, bool usesMailbox); |
| 47 | 48 |
| 48 virtual const char* layerTypeAsString() const OVERRIDE; | 49 virtual const char* layerTypeAsString() const OVERRIDE; |
| 49 | 50 |
| 50 unsigned m_textureId; | 51 unsigned m_textureId; |
| 51 ResourceProvider::ResourceId m_externalTextureResource; | 52 ResourceProvider::ResourceId m_externalTextureResource; |
| 52 bool m_premultipliedAlpha; | 53 bool m_premultipliedAlpha; |
| 53 bool m_flipped; | 54 bool m_flipped; |
| 54 gfx::RectF m_uvRect; | 55 gfx::PointF m_uvTopLeft; |
| 56 gfx::PointF m_uvBottomRight; |
| 55 float m_vertexOpacity[4]; | 57 float m_vertexOpacity[4]; |
| 56 | 58 |
| 57 bool m_hasPendingMailbox; | 59 bool m_hasPendingMailbox; |
| 58 std::string m_pendingMailboxName; | 60 std::string m_pendingMailboxName; |
| 59 base::Callback<void(unsigned)> m_pendingMailboxReleaseCallback; | 61 base::Callback<void(unsigned)> m_pendingMailboxReleaseCallback; |
| 60 bool m_usesMailbox; | 62 bool m_usesMailbox; |
| 61 }; | 63 }; |
| 62 | 64 |
| 63 } | 65 } |
| 64 | 66 |
| 65 #endif // CC_TEXTURE_LAYER_IMPL_H_ | 67 #endif // CC_TEXTURE_LAYER_IMPL_H_ |
| OLD | NEW |