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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 } | 53 } |
54 | 54 |
55 void WebExternalTextureLayerImpl::setBlendBackgroundColor(bool blend) { | 55 void WebExternalTextureLayerImpl::setBlendBackgroundColor(bool blend) { |
56 static_cast<TextureLayer*>(layer_->layer())->SetBlendBackgroundColor(blend); | 56 static_cast<TextureLayer*>(layer_->layer())->SetBlendBackgroundColor(blend); |
57 } | 57 } |
58 | 58 |
59 void WebExternalTextureLayerImpl::setRateLimitContext(bool rate_limit) { | 59 void WebExternalTextureLayerImpl::setRateLimitContext(bool rate_limit) { |
60 static_cast<TextureLayer*>(layer_->layer())->SetRateLimitContext(rate_limit); | 60 static_cast<TextureLayer*>(layer_->layer())->SetRateLimitContext(rate_limit); |
61 } | 61 } |
62 | 62 |
63 unsigned WebExternalTextureLayerImpl::PrepareTexture() { | |
64 NOTREACHED(); | |
65 return 0; | |
66 } | |
67 | |
68 bool WebExternalTextureLayerImpl::PrepareTextureMailbox( | 63 bool WebExternalTextureLayerImpl::PrepareTextureMailbox( |
69 cc::TextureMailbox* mailbox, | 64 cc::TextureMailbox* mailbox, |
70 scoped_ptr<cc::SingleReleaseCallback>* release_callback, | 65 scoped_ptr<cc::SingleReleaseCallback>* release_callback, |
71 bool use_shared_memory) { | 66 bool use_shared_memory) { |
72 blink::WebExternalTextureMailbox client_mailbox; | 67 blink::WebExternalTextureMailbox client_mailbox; |
73 WebExternalBitmapImpl* bitmap = NULL; | 68 WebExternalBitmapImpl* bitmap = NULL; |
74 | 69 |
75 if (use_shared_memory) | 70 if (use_shared_memory) |
76 bitmap = AllocateBitmap(); | 71 bitmap = AllocateBitmap(); |
77 if (!client_->prepareMailbox(&client_mailbox, bitmap)) { | 72 if (!client_->prepareMailbox(&client_mailbox, bitmap)) { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 117 |
123 blink::WebExternalTextureMailbox available_mailbox; | 118 blink::WebExternalTextureMailbox available_mailbox; |
124 memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name)); | 119 memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name)); |
125 available_mailbox.syncPoint = sync_point; | 120 available_mailbox.syncPoint = sync_point; |
126 if (bitmap) | 121 if (bitmap) |
127 layer->free_bitmaps_.push_back(bitmap); | 122 layer->free_bitmaps_.push_back(bitmap); |
128 layer->client_->mailboxReleased(available_mailbox); | 123 layer->client_->mailboxReleased(available_mailbox); |
129 } | 124 } |
130 | 125 |
131 } // namespace webkit | 126 } // namespace webkit |
OLD | NEW |