| 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 "webkit/compositor_bindings/web_external_texture_layer_impl.h" | 5 #include "webkit/compositor_bindings/web_external_texture_layer_impl.h" |
| 6 | 6 |
| 7 #include "cc/resource_update_queue.h" | 7 #include "cc/resource_update_queue.h" |
| 8 #include "cc/texture_layer.h" | 8 #include "cc/texture_layer.h" |
| 9 #include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureL
ayerClient.h" | 9 #include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureL
ayerClient.h" |
| 10 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" | 10 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 void WebExternalTextureLayerImpl::willModifyTexture() { | 60 void WebExternalTextureLayerImpl::willModifyTexture() { |
| 61 static_cast<TextureLayer*>(layer_->layer())->WillModifyTexture(); | 61 static_cast<TextureLayer*>(layer_->layer())->WillModifyTexture(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void WebExternalTextureLayerImpl::setRateLimitContext(bool rate_limit) { | 64 void WebExternalTextureLayerImpl::setRateLimitContext(bool rate_limit) { |
| 65 static_cast<TextureLayer*>(layer_->layer())->SetRateLimitContext(rate_limit); | 65 static_cast<TextureLayer*>(layer_->layer())->SetRateLimitContext(rate_limit); |
| 66 } | 66 } |
| 67 | 67 |
| 68 class WebTextureUpdaterImpl : public WebTextureUpdater { | 68 class WebTextureUpdaterImpl : public WebTextureUpdater { |
| 69 public: | 69 public: |
| 70 explicit WebTextureUpdaterImpl(ResourceUpdateQueue& queue) : queue_(queue) {} | 70 explicit WebTextureUpdaterImpl(ResourceUpdateQueue* queue) : queue_(queue) {} |
| 71 | 71 |
| 72 virtual void appendCopy(unsigned source_texture, | 72 virtual void appendCopy(unsigned source_texture, |
| 73 unsigned destination_texture, | 73 unsigned destination_texture, |
| 74 WebSize size) OVERRIDE { | 74 WebSize size) OVERRIDE { |
| 75 TextureCopier::Parameters copy = { source_texture, destination_texture, | 75 TextureCopier::Parameters copy = { source_texture, destination_texture, |
| 76 size }; | 76 size }; |
| 77 queue_.appendCopy(copy); | 77 queue_->appendCopy(copy); |
| 78 } | 78 } |
| 79 | 79 |
| 80 private: | 80 private: |
| 81 ResourceUpdateQueue& queue_; | 81 ResourceUpdateQueue* queue_; |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 unsigned WebExternalTextureLayerImpl::prepareTexture( | 84 unsigned WebExternalTextureLayerImpl::PrepareTexture( |
| 85 ResourceUpdateQueue& queue) { | 85 ResourceUpdateQueue* queue) { |
| 86 DCHECK(client_); | 86 DCHECK(client_); |
| 87 WebTextureUpdaterImpl updater_impl(queue); | 87 WebTextureUpdaterImpl updater_impl(queue); |
| 88 return client_->prepareTexture(updater_impl); | 88 return client_->prepareTexture(updater_impl); |
| 89 } | 89 } |
| 90 | 90 |
| 91 WebGraphicsContext3D* WebExternalTextureLayerImpl::context() { | 91 WebGraphicsContext3D* WebExternalTextureLayerImpl::Context() { |
| 92 DCHECK(client_); | 92 DCHECK(client_); |
| 93 return client_->context(); | 93 return client_->context(); |
| 94 } | 94 } |
| 95 | 95 |
| 96 } // namespace WebKit | 96 } // namespace WebKit |
| OLD | NEW |