| 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 "cc/blink/web_external_texture_layer_impl.h" | 5 #include "cc/blink/web_external_texture_layer_impl.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "cc/blink/web_external_bitmap_impl.h" | 8 #include "cc/blink/web_external_bitmap_impl.h" |
| 9 #include "cc/blink/web_layer_impl.h" | 9 #include "cc/blink/web_layer_impl.h" |
| 10 #include "cc/layers/texture_layer.h" | 10 #include "cc/layers/texture_layer.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 memcpy(&sync_token, client_mailbox.syncToken, sizeof(sync_token)); | 87 memcpy(&sync_token, client_mailbox.syncToken, sizeof(sync_token)); |
| 88 | 88 |
| 89 gfx::Size size; | 89 gfx::Size size; |
| 90 if (client_mailbox.allowOverlay) { | 90 if (client_mailbox.allowOverlay) { |
| 91 size = gfx::Size(client_mailbox.textureSize.width, | 91 size = gfx::Size(client_mailbox.textureSize.width, |
| 92 client_mailbox.textureSize.height); | 92 client_mailbox.textureSize.height); |
| 93 } | 93 } |
| 94 | 94 |
| 95 *mailbox = cc::TextureMailbox( | 95 *mailbox = cc::TextureMailbox( |
| 96 name, sync_token, client_mailbox.textureTarget, size, | 96 name, sync_token, client_mailbox.textureTarget, size, |
| 97 gfx::GpuMemoryBufferId(client_mailbox.gpuMemoryBufferId), | |
| 98 client_mailbox.allowOverlay, false); | 97 client_mailbox.allowOverlay, false); |
| 99 } | 98 } |
| 100 mailbox->set_nearest_neighbor(client_mailbox.nearestNeighbor); | 99 mailbox->set_nearest_neighbor(client_mailbox.nearestNeighbor); |
| 101 | 100 |
| 102 if (mailbox->IsValid()) { | 101 if (mailbox->IsValid()) { |
| 103 *release_callback = cc::SingleReleaseCallback::Create( | 102 *release_callback = cc::SingleReleaseCallback::Create( |
| 104 base::Bind(&WebExternalTextureLayerImpl::DidReleaseMailbox, | 103 base::Bind(&WebExternalTextureLayerImpl::DidReleaseMailbox, |
| 105 this->AsWeakPtr(), | 104 this->AsWeakPtr(), |
| 106 client_mailbox, | 105 client_mailbox, |
| 107 bitmap)); | 106 bitmap)); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 133 memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name)); | 132 memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name)); |
| 134 memcpy(available_mailbox.syncToken, sync_token.GetConstData(), | 133 memcpy(available_mailbox.syncToken, sync_token.GetConstData(), |
| 135 sizeof(sync_token)); | 134 sizeof(sync_token)); |
| 136 available_mailbox.validSyncToken = sync_token.HasData(); | 135 available_mailbox.validSyncToken = sync_token.HasData(); |
| 137 if (bitmap) | 136 if (bitmap) |
| 138 layer->free_bitmaps_.push_back(base::WrapUnique(bitmap)); | 137 layer->free_bitmaps_.push_back(base::WrapUnique(bitmap)); |
| 139 layer->client_->mailboxReleased(available_mailbox, lost_resource); | 138 layer->client_->mailboxReleased(available_mailbox, lost_resource); |
| 140 } | 139 } |
| 141 | 140 |
| 142 } // namespace cc_blink | 141 } // namespace cc_blink |
| OLD | NEW |