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/renderer/compositor_bindings/web_external_texture_layer_impl.h" | 5 #include "webkit/renderer/compositor_bindings/web_external_texture_layer_impl.h" |
6 | 6 |
7 #include "cc/layers/texture_layer.h" | 7 #include "cc/layers/texture_layer.h" |
8 #include "cc/resources/resource_update_queue.h" | 8 #include "cc/resources/resource_update_queue.h" |
9 #include "third_party/WebKit/public/platform/WebExternalTextureLayerClient.h" | 9 #include "third_party/WebKit/public/platform/WebExternalTextureLayerClient.h" |
10 #include "third_party/WebKit/public/platform/WebExternalTextureMailbox.h" | 10 #include "third_party/WebKit/public/platform/WebExternalTextureMailbox.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 } | 28 } |
29 | 29 |
30 WebExternalTextureLayerImpl::~WebExternalTextureLayerImpl() { | 30 WebExternalTextureLayerImpl::~WebExternalTextureLayerImpl() { |
31 static_cast<TextureLayer*>(layer_->layer())->ClearClient(); | 31 static_cast<TextureLayer*>(layer_->layer())->ClearClient(); |
32 } | 32 } |
33 | 33 |
34 WebKit::WebLayer* WebExternalTextureLayerImpl::layer() { return layer_.get(); } | 34 WebKit::WebLayer* WebExternalTextureLayerImpl::layer() { return layer_.get(); } |
35 | 35 |
36 void WebExternalTextureLayerImpl::clearTexture() { | 36 void WebExternalTextureLayerImpl::clearTexture() { |
37 TextureLayer *layer = static_cast<TextureLayer*>(layer_->layer()); | 37 TextureLayer *layer = static_cast<TextureLayer*>(layer_->layer()); |
38 layer->WillModifyTexture(); | 38 layer->ClearTexture(); |
39 layer->SetTextureMailbox(cc::TextureMailbox()); | |
40 } | 39 } |
41 | 40 |
42 void WebExternalTextureLayerImpl::setOpaque(bool opaque) { | 41 void WebExternalTextureLayerImpl::setOpaque(bool opaque) { |
43 static_cast<TextureLayer*>(layer_->layer())->SetContentsOpaque(opaque); | 42 static_cast<TextureLayer*>(layer_->layer())->SetContentsOpaque(opaque); |
44 } | 43 } |
45 | 44 |
46 void WebExternalTextureLayerImpl::setPremultipliedAlpha( | 45 void WebExternalTextureLayerImpl::setPremultipliedAlpha( |
47 bool premultiplied_alpha) { | 46 bool premultiplied_alpha) { |
48 static_cast<TextureLayer*>(layer_->layer())->SetPremultipliedAlpha( | 47 static_cast<TextureLayer*>(layer_->layer())->SetPremultipliedAlpha( |
49 premultiplied_alpha); | 48 premultiplied_alpha); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 118 |
120 WebKit::WebExternalTextureMailbox available_mailbox; | 119 WebKit::WebExternalTextureMailbox available_mailbox; |
121 memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name)); | 120 memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name)); |
122 available_mailbox.syncPoint = sync_point; | 121 available_mailbox.syncPoint = sync_point; |
123 if (bitmap) | 122 if (bitmap) |
124 layer->free_bitmaps_.push_back(bitmap); | 123 layer->free_bitmaps_.push_back(bitmap); |
125 layer->client_->mailboxReleased(available_mailbox); | 124 layer->client_->mailboxReleased(available_mailbox); |
126 } | 125 } |
127 | 126 |
128 } // namespace webkit | 127 } // namespace webkit |
OLD | NEW |