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 "TextureLayerChromium.h" | 7 #include "TextureLayerChromium.h" |
8 | 8 |
| 9 #include "third_party/khronos/GLES2/gl2.h" |
9 #include "CCLayerTreeHost.h" | 10 #include "CCLayerTreeHost.h" |
10 #include "CCTextureLayerImpl.h" | 11 #include "CCTextureLayerImpl.h" |
11 #include "GraphicsContext3D.h" | |
12 #include "TextureLayerChromiumClient.h" | 12 #include "TextureLayerChromiumClient.h" |
13 #include <public/WebGraphicsContext3D.h> | 13 #include <public/WebGraphicsContext3D.h> |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 | 16 |
17 scoped_refptr<TextureLayerChromium> TextureLayerChromium::create(TextureLayerChr
omiumClient* client) | 17 scoped_refptr<TextureLayerChromium> TextureLayerChromium::create(TextureLayerChr
omiumClient* client) |
18 { | 18 { |
19 return scoped_refptr<TextureLayerChromium>(new TextureLayerChromium(client))
; | 19 return scoped_refptr<TextureLayerChromium>(new TextureLayerChromium(client))
; |
20 } | 20 } |
21 | 21 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 bool TextureLayerChromium::drawsContent() const | 106 bool TextureLayerChromium::drawsContent() const |
107 { | 107 { |
108 return (m_client || m_textureId) && !m_contextLost && LayerChromium::drawsCo
ntent(); | 108 return (m_client || m_textureId) && !m_contextLost && LayerChromium::drawsCo
ntent(); |
109 } | 109 } |
110 | 110 |
111 void TextureLayerChromium::update(CCTextureUpdateQueue& queue, const CCOcclusion
Tracker*, CCRenderingStats&) | 111 void TextureLayerChromium::update(CCTextureUpdateQueue& queue, const CCOcclusion
Tracker*, CCRenderingStats&) |
112 { | 112 { |
113 if (m_client) { | 113 if (m_client) { |
114 m_textureId = m_client->prepareTexture(queue); | 114 m_textureId = m_client->prepareTexture(queue); |
115 m_contextLost = m_client->context()->getGraphicsResetStatusARB() != Grap
hicsContext3D::NO_ERROR; | 115 m_contextLost = m_client->context()->getGraphicsResetStatusARB() != GL_N
O_ERROR; |
116 } | 116 } |
117 | 117 |
118 m_needsDisplay = false; | 118 m_needsDisplay = false; |
119 } | 119 } |
120 | 120 |
121 void TextureLayerChromium::pushPropertiesTo(CCLayerImpl* layer) | 121 void TextureLayerChromium::pushPropertiesTo(CCLayerImpl* layer) |
122 { | 122 { |
123 LayerChromium::pushPropertiesTo(layer); | 123 LayerChromium::pushPropertiesTo(layer); |
124 | 124 |
125 CCTextureLayerImpl* textureLayer = static_cast<CCTextureLayerImpl*>(layer); | 125 CCTextureLayerImpl* textureLayer = static_cast<CCTextureLayerImpl*>(layer); |
126 textureLayer->setFlipped(m_flipped); | 126 textureLayer->setFlipped(m_flipped); |
127 textureLayer->setUVRect(m_uvRect); | 127 textureLayer->setUVRect(m_uvRect); |
128 textureLayer->setPremultipliedAlpha(m_premultipliedAlpha); | 128 textureLayer->setPremultipliedAlpha(m_premultipliedAlpha); |
129 textureLayer->setTextureId(m_textureId); | 129 textureLayer->setTextureId(m_textureId); |
130 } | 130 } |
131 | 131 |
132 } | 132 } |
OLD | NEW |