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 "cc/resources/single_release_callback.h" | 9 #include "cc/resources/single_release_callback.h" |
10 #include "cc/resources/texture_mailbox.h" | 10 #include "cc/resources/texture_mailbox.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 } | 32 } |
33 | 33 |
34 WebExternalTextureLayerImpl::~WebExternalTextureLayerImpl() { | 34 WebExternalTextureLayerImpl::~WebExternalTextureLayerImpl() { |
35 static_cast<TextureLayer*>(layer_->layer())->ClearClient(); | 35 static_cast<TextureLayer*>(layer_->layer())->ClearClient(); |
36 } | 36 } |
37 | 37 |
38 blink::WebLayer* WebExternalTextureLayerImpl::layer() { return layer_.get(); } | 38 blink::WebLayer* WebExternalTextureLayerImpl::layer() { return layer_.get(); } |
39 | 39 |
40 void WebExternalTextureLayerImpl::clearTexture() { | 40 void WebExternalTextureLayerImpl::clearTexture() { |
41 TextureLayer *layer = static_cast<TextureLayer*>(layer_->layer()); | 41 TextureLayer *layer = static_cast<TextureLayer*>(layer_->layer()); |
42 layer->WillModifyTexture(); | 42 layer->ClearTexture(); |
43 layer->SetTextureMailbox(cc::TextureMailbox(), | |
44 scoped_ptr<cc::SingleReleaseCallback>()); | |
45 } | 43 } |
46 | 44 |
47 void WebExternalTextureLayerImpl::setOpaque(bool opaque) { | 45 void WebExternalTextureLayerImpl::setOpaque(bool opaque) { |
48 static_cast<TextureLayer*>(layer_->layer())->SetContentsOpaque(opaque); | 46 static_cast<TextureLayer*>(layer_->layer())->SetContentsOpaque(opaque); |
49 } | 47 } |
50 | 48 |
51 void WebExternalTextureLayerImpl::setPremultipliedAlpha( | 49 void WebExternalTextureLayerImpl::setPremultipliedAlpha( |
52 bool premultiplied_alpha) { | 50 bool premultiplied_alpha) { |
53 static_cast<TextureLayer*>(layer_->layer())->SetPremultipliedAlpha( | 51 static_cast<TextureLayer*>(layer_->layer())->SetPremultipliedAlpha( |
54 premultiplied_alpha); | 52 premultiplied_alpha); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 122 |
125 blink::WebExternalTextureMailbox available_mailbox; | 123 blink::WebExternalTextureMailbox available_mailbox; |
126 memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name)); | 124 memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name)); |
127 available_mailbox.syncPoint = sync_point; | 125 available_mailbox.syncPoint = sync_point; |
128 if (bitmap) | 126 if (bitmap) |
129 layer->free_bitmaps_.push_back(bitmap); | 127 layer->free_bitmaps_.push_back(bitmap); |
130 layer->client_->mailboxReleased(available_mailbox); | 128 layer->client_->mailboxReleased(available_mailbox); |
131 } | 129 } |
132 | 130 |
133 } // namespace webkit | 131 } // namespace webkit |
OLD | NEW |