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(gfx::PointF topLeft, 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 20 matching lines...) Expand all Loading... |
74 protected: | 74 protected: |
75 TextureLayer(TextureLayerClient*, bool usesMailbox); | 75 TextureLayer(TextureLayerClient*, bool usesMailbox); |
76 virtual ~TextureLayer(); | 76 virtual ~TextureLayer(); |
77 | 77 |
78 private: | 78 private: |
79 TextureLayerClient* m_client; | 79 TextureLayerClient* m_client; |
80 bool m_usesMailbox; | 80 bool m_usesMailbox; |
81 MailboxCallback m_mailboxReleaseCallback; | 81 MailboxCallback m_mailboxReleaseCallback; |
82 | 82 |
83 bool m_flipped; | 83 bool m_flipped; |
84 gfx::RectF m_uvRect; | 84 gfx::PointF m_uvTopLeft; |
| 85 gfx::PointF m_uvBottomRight; |
85 // [bottom left, top left, top right, bottom right] | 86 // [bottom left, top left, top right, bottom right] |
86 float m_vertexOpacity[4]; | 87 float m_vertexOpacity[4]; |
87 bool m_premultipliedAlpha; | 88 bool m_premultipliedAlpha; |
88 bool m_rateLimitContext; | 89 bool m_rateLimitContext; |
89 bool m_contextLost; | 90 bool m_contextLost; |
90 bool m_contentCommitted; | 91 bool m_contentCommitted; |
91 | 92 |
92 unsigned m_textureId; | 93 unsigned m_textureId; |
93 std::string m_mailboxName; | 94 std::string m_mailboxName; |
94 }; | 95 }; |
95 | 96 |
96 } | 97 } |
97 #endif // CC_TEXTURE_LAYER_H_ | 98 #endif // CC_TEXTURE_LAYER_H_ |
OLD | NEW |