| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 #include "web_external_texture_layer_impl.h" | 6 #include "web_external_texture_layer_impl.h" |
| 7 | 7 |
| 8 #include "cc/resource_update_queue.h" | 8 #include "cc/resource_update_queue.h" |
| 9 #include "cc/texture_layer.h" | 9 #include "cc/texture_layer.h" |
| 10 #include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureL
ayerClient.h" | 10 #include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureL
ayerClient.h" |
| 11 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" | 11 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" |
| 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" | 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" |
| 13 #include "web_layer_impl.h" | 13 #include "web_layer_impl.h" |
| 14 #include "webcore_convert.h" | |
| 15 | 14 |
| 16 using namespace cc; | 15 using namespace cc; |
| 17 | 16 |
| 18 namespace WebKit { | 17 namespace WebKit { |
| 19 | 18 |
| 20 WebExternalTextureLayer* WebExternalTextureLayer::create(WebExternalTextureLayer
Client* client) | 19 WebExternalTextureLayer* WebExternalTextureLayer::create(WebExternalTextureLayer
Client* client) |
| 21 { | 20 { |
| 22 return new WebExternalTextureLayerImpl(client); | 21 return new WebExternalTextureLayerImpl(client); |
| 23 } | 22 } |
| 24 | 23 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 80 |
| 82 class WebTextureUpdaterImpl : public WebTextureUpdater { | 81 class WebTextureUpdaterImpl : public WebTextureUpdater { |
| 83 public: | 82 public: |
| 84 explicit WebTextureUpdaterImpl(ResourceUpdateQueue& queue) | 83 explicit WebTextureUpdaterImpl(ResourceUpdateQueue& queue) |
| 85 : m_queue(queue) | 84 : m_queue(queue) |
| 86 { | 85 { |
| 87 } | 86 } |
| 88 | 87 |
| 89 virtual void appendCopy(unsigned sourceTexture, unsigned destinationTexture,
WebSize size) OVERRIDE | 88 virtual void appendCopy(unsigned sourceTexture, unsigned destinationTexture,
WebSize size) OVERRIDE |
| 90 { | 89 { |
| 91 TextureCopier::Parameters copy = { sourceTexture, destinationTexture, co
nvert(size) }; | 90 TextureCopier::Parameters copy = { sourceTexture, destinationTexture, si
ze }; |
| 92 m_queue.appendCopy(copy); | 91 m_queue.appendCopy(copy); |
| 93 } | 92 } |
| 94 | 93 |
| 95 private: | 94 private: |
| 96 ResourceUpdateQueue& m_queue; | 95 ResourceUpdateQueue& m_queue; |
| 97 }; | 96 }; |
| 98 | 97 |
| 99 unsigned WebExternalTextureLayerImpl::prepareTexture(ResourceUpdateQueue& queue) | 98 unsigned WebExternalTextureLayerImpl::prepareTexture(ResourceUpdateQueue& queue) |
| 100 { | 99 { |
| 101 ASSERT(m_client); | 100 ASSERT(m_client); |
| 102 WebTextureUpdaterImpl updaterImpl(queue); | 101 WebTextureUpdaterImpl updaterImpl(queue); |
| 103 return m_client->prepareTexture(updaterImpl); | 102 return m_client->prepareTexture(updaterImpl); |
| 104 } | 103 } |
| 105 | 104 |
| 106 WebGraphicsContext3D* WebExternalTextureLayerImpl::context() | 105 WebGraphicsContext3D* WebExternalTextureLayerImpl::context() |
| 107 { | 106 { |
| 108 ASSERT(m_client); | 107 ASSERT(m_client); |
| 109 return m_client->context(); | 108 return m_client->context(); |
| 110 } | 109 } |
| 111 | 110 |
| 112 } // namespace WebKit | 111 } // namespace WebKit |
| OLD | NEW |