| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/renderer/compositor_bindings/web_external_texture_layer_impl.h
" | 5 #include "content/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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 return new WebExternalBitmapImpl; | 106 return new WebExternalBitmapImpl; |
| 107 } | 107 } |
| 108 | 108 |
| 109 // static | 109 // static |
| 110 void WebExternalTextureLayerImpl::DidReleaseMailbox( | 110 void WebExternalTextureLayerImpl::DidReleaseMailbox( |
| 111 base::WeakPtr<WebExternalTextureLayerImpl> layer, | 111 base::WeakPtr<WebExternalTextureLayerImpl> layer, |
| 112 const blink::WebExternalTextureMailbox& mailbox, | 112 const blink::WebExternalTextureMailbox& mailbox, |
| 113 WebExternalBitmapImpl* bitmap, | 113 WebExternalBitmapImpl* bitmap, |
| 114 unsigned sync_point, | 114 unsigned sync_point, |
| 115 bool lost_resource) { | 115 bool lost_resource) { |
| 116 if (lost_resource || !layer) { | 116 if (!layer) { |
| 117 delete bitmap; | 117 delete bitmap; |
| 118 return; | 118 return; |
| 119 } | 119 } |
| 120 | 120 |
| 121 blink::WebExternalTextureMailbox available_mailbox; | 121 blink::WebExternalTextureMailbox available_mailbox; |
| 122 memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name)); | 122 memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name)); |
| 123 available_mailbox.syncPoint = sync_point; | 123 available_mailbox.syncPoint = sync_point; |
| 124 if (bitmap) | 124 if (bitmap) |
| 125 layer->free_bitmaps_.push_back(bitmap); | 125 layer->free_bitmaps_.push_back(bitmap); |
| 126 layer->client_->mailboxReleased(available_mailbox); | 126 layer->client_->mailboxReleased(available_mailbox, lost_resource); |
| 127 } | 127 } |
| 128 | 128 |
| 129 } // namespace content | 129 } // namespace content |
| 130 | 130 |
| OLD | NEW |