| 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 CC_TEXTURE_LAYER_H_ | 5 #ifndef CC_TEXTURE_LAYER_H_ |
| 6 #define CC_TEXTURE_LAYER_H_ | 6 #define CC_TEXTURE_LAYER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // Used when mailbox names are specified instead of texture IDs. | 32 // Used when mailbox names are specified instead of texture IDs. |
| 33 static scoped_refptr<TextureLayer> createForMailbox(); | 33 static scoped_refptr<TextureLayer> createForMailbox(); |
| 34 | 34 |
| 35 void clearClient() { m_client = 0; } | 35 void clearClient() { m_client = 0; } |
| 36 | 36 |
| 37 virtual scoped_ptr<LayerImpl> createLayerImpl(LayerTreeImpl* treeImpl) OVERR
IDE; | 37 virtual scoped_ptr<LayerImpl> createLayerImpl(LayerTreeImpl* treeImpl) OVERR
IDE; |
| 38 | 38 |
| 39 // Sets whether this texture should be Y-flipped at draw time. Defaults to t
rue. | 39 // Sets whether this texture should be Y-flipped at draw time. Defaults to t
rue. |
| 40 void setFlipped(bool); | 40 void setFlipped(bool); |
| 41 | 41 |
| 42 // Sets a UV transform to be used at draw time. Defaults to (0, 0, 1, 1). | 42 // Sets a UV transform to be used at draw time. Defaults to (0, 0) and (1, 1
). |
| 43 void setUVRect(const gfx::RectF&); | 43 void setUV(const gfx::PointF& topLeft, const gfx::PointF& bottomRight); |
| 44 | 44 |
| 45 // Sets an opacity value per vertex. It will be multiplied by the layer opac
ity value. | 45 // Sets an opacity value per vertex. It will be multiplied by the layer opac
ity value. |
| 46 void setVertexOpacity(float bottomLeft, float topLeft, float topRight, float
bottomRight); | 46 void setVertexOpacity(float bottomLeft, float topLeft, float topRight, float
bottomRight); |
| 47 | 47 |
| 48 // Sets whether the alpha channel is premultiplied or unpremultiplied. Defau
lts to true. | 48 // Sets whether the alpha channel is premultiplied or unpremultiplied. Defau
lts to true. |
| 49 void setPremultipliedAlpha(bool); | 49 void setPremultipliedAlpha(bool); |
| 50 | 50 |
| 51 // Sets whether this context should rate limit on damage to prevent too many
frames from | 51 // Sets whether this context should rate limit on damage to prevent too many
frames from |
| 52 // being queued up before the compositor gets a chance to run. Requires a no
n-nil client. | 52 // being queued up before the compositor gets a chance to run. Requires a no
n-nil client. |
| 53 // Defaults to false. | 53 // Defaults to false. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 72 protected: | 72 protected: |
| 73 TextureLayer(TextureLayerClient*, bool usesMailbox); | 73 TextureLayer(TextureLayerClient*, bool usesMailbox); |
| 74 virtual ~TextureLayer(); | 74 virtual ~TextureLayer(); |
| 75 | 75 |
| 76 private: | 76 private: |
| 77 TextureLayerClient* m_client; | 77 TextureLayerClient* m_client; |
| 78 bool m_usesMailbox; | 78 bool m_usesMailbox; |
| 79 MailboxCallback m_mailboxReleaseCallback; | 79 MailboxCallback m_mailboxReleaseCallback; |
| 80 | 80 |
| 81 bool m_flipped; | 81 bool m_flipped; |
| 82 gfx::RectF m_uvRect; | 82 gfx::PointF m_uvTopLeft; |
| 83 gfx::PointF m_uvBottomRight; |
| 83 // [bottom left, top left, top right, bottom right] | 84 // [bottom left, top left, top right, bottom right] |
| 84 float m_vertexOpacity[4]; | 85 float m_vertexOpacity[4]; |
| 85 bool m_premultipliedAlpha; | 86 bool m_premultipliedAlpha; |
| 86 bool m_rateLimitContext; | 87 bool m_rateLimitContext; |
| 87 bool m_contextLost; | 88 bool m_contextLost; |
| 88 bool m_contentCommitted; | 89 bool m_contentCommitted; |
| 89 | 90 |
| 90 unsigned m_textureId; | 91 unsigned m_textureId; |
| 91 std::string m_mailboxName; | 92 std::string m_mailboxName; |
| 92 }; | 93 }; |
| 93 | 94 |
| 94 } | 95 } |
| 95 #endif // CC_TEXTURE_LAYER_H_ | 96 #endif // CC_TEXTURE_LAYER_H_ |
| OLD | NEW |