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 #include "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "cc/texture_layer.h" | 7 #include "cc/texture_layer.h" |
8 | 8 |
9 #include "third_party/khronos/GLES2/gl2.h" | 9 #include "third_party/khronos/GLES2/gl2.h" |
10 #include "cc/layer_tree_host.h" | 10 #include "cc/layer_tree_host.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 { | 44 { |
45 return TextureLayerImpl::create(m_layerId).PassAs<LayerImpl>(); | 45 return TextureLayerImpl::create(m_layerId).PassAs<LayerImpl>(); |
46 } | 46 } |
47 | 47 |
48 void TextureLayer::setFlipped(bool flipped) | 48 void TextureLayer::setFlipped(bool flipped) |
49 { | 49 { |
50 m_flipped = flipped; | 50 m_flipped = flipped; |
51 setNeedsCommit(); | 51 setNeedsCommit(); |
52 } | 52 } |
53 | 53 |
54 void TextureLayer::setUVRect(const FloatRect& rect) | 54 void TextureLayer::setUVRect(const gfx::RectF& rect) |
55 { | 55 { |
56 m_uvRect = rect; | 56 m_uvRect = rect; |
57 setNeedsCommit(); | 57 setNeedsCommit(); |
58 } | 58 } |
59 | 59 |
60 void TextureLayer::setPremultipliedAlpha(bool premultipliedAlpha) | 60 void TextureLayer::setPremultipliedAlpha(bool premultipliedAlpha) |
61 { | 61 { |
62 m_premultipliedAlpha = premultipliedAlpha; | 62 m_premultipliedAlpha = premultipliedAlpha; |
63 setNeedsCommit(); | 63 setNeedsCommit(); |
64 } | 64 } |
(...skipping 15 matching lines...) Expand all Loading... |
80 m_textureId = id; | 80 m_textureId = id; |
81 setNeedsCommit(); | 81 setNeedsCommit(); |
82 } | 82 } |
83 | 83 |
84 void TextureLayer::willModifyTexture() | 84 void TextureLayer::willModifyTexture() |
85 { | 85 { |
86 if (layerTreeHost()) | 86 if (layerTreeHost()) |
87 layerTreeHost()->acquireLayerTextures(); | 87 layerTreeHost()->acquireLayerTextures(); |
88 } | 88 } |
89 | 89 |
90 void TextureLayer::setNeedsDisplayRect(const FloatRect& dirtyRect) | 90 void TextureLayer::setNeedsDisplayRect(const gfx::RectF& dirtyRect) |
91 { | 91 { |
92 Layer::setNeedsDisplayRect(dirtyRect); | 92 Layer::setNeedsDisplayRect(dirtyRect); |
93 | 93 |
94 if (m_rateLimitContext && m_client && layerTreeHost()) | 94 if (m_rateLimitContext && m_client && layerTreeHost()) |
95 layerTreeHost()->startRateLimiter(m_client->context()); | 95 layerTreeHost()->startRateLimiter(m_client->context()); |
96 } | 96 } |
97 | 97 |
98 void TextureLayer::setLayerTreeHost(LayerTreeHost* host) | 98 void TextureLayer::setLayerTreeHost(LayerTreeHost* host) |
99 { | 99 { |
100 if (m_textureId && layerTreeHost() && host != layerTreeHost()) | 100 if (m_textureId && layerTreeHost() && host != layerTreeHost()) |
(...skipping 21 matching lines...) Expand all Loading... |
122 Layer::pushPropertiesTo(layer); | 122 Layer::pushPropertiesTo(layer); |
123 | 123 |
124 TextureLayerImpl* textureLayer = static_cast<TextureLayerImpl*>(layer); | 124 TextureLayerImpl* textureLayer = static_cast<TextureLayerImpl*>(layer); |
125 textureLayer->setFlipped(m_flipped); | 125 textureLayer->setFlipped(m_flipped); |
126 textureLayer->setUVRect(m_uvRect); | 126 textureLayer->setUVRect(m_uvRect); |
127 textureLayer->setPremultipliedAlpha(m_premultipliedAlpha); | 127 textureLayer->setPremultipliedAlpha(m_premultipliedAlpha); |
128 textureLayer->setTextureId(m_textureId); | 128 textureLayer->setTextureId(m_textureId); |
129 } | 129 } |
130 | 130 |
131 } | 131 } |
OLD | NEW |