| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 if (m_textureId && layerTreeHost() && host != layerTreeHost()) | 100 if (m_textureId && layerTreeHost() && host != layerTreeHost()) |
| 101 layerTreeHost()->acquireLayerTextures(); | 101 layerTreeHost()->acquireLayerTextures(); |
| 102 Layer::setLayerTreeHost(host); | 102 Layer::setLayerTreeHost(host); |
| 103 } | 103 } |
| 104 | 104 |
| 105 bool TextureLayer::drawsContent() const | 105 bool TextureLayer::drawsContent() const |
| 106 { | 106 { |
| 107 return (m_client || m_textureId) && !m_contextLost && Layer::drawsContent(); | 107 return (m_client || m_textureId) && !m_contextLost && Layer::drawsContent(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void TextureLayer::update(TextureUpdateQueue& queue, const OcclusionTracker*, Re
nderingStats&) | 110 void TextureLayer::update(ResourceUpdateQueue& queue, const OcclusionTracker*, R
enderingStats&) |
| 111 { | 111 { |
| 112 if (m_client) { | 112 if (m_client) { |
| 113 m_textureId = m_client->prepareTexture(queue); | 113 m_textureId = m_client->prepareTexture(queue); |
| 114 m_contextLost = m_client->context()->getGraphicsResetStatusARB() != GL_N
O_ERROR; | 114 m_contextLost = m_client->context()->getGraphicsResetStatusARB() != GL_N
O_ERROR; |
| 115 } | 115 } |
| 116 | 116 |
| 117 m_needsDisplay = false; | 117 m_needsDisplay = false; |
| 118 } | 118 } |
| 119 | 119 |
| 120 void TextureLayer::pushPropertiesTo(LayerImpl* layer) | 120 void TextureLayer::pushPropertiesTo(LayerImpl* layer) |
| 121 { | 121 { |
| 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 |