Chromium Code Reviews| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 | 75 |
| 76 if (use_shared_memory) | 76 if (use_shared_memory) |
| 77 bitmap = AllocateBitmap(); | 77 bitmap = AllocateBitmap(); |
| 78 if (!client_->prepareMailbox(&client_mailbox, bitmap)) { | 78 if (!client_->prepareMailbox(&client_mailbox, bitmap)) { |
| 79 if (bitmap) | 79 if (bitmap) |
| 80 free_bitmaps_.push_back(bitmap); | 80 free_bitmaps_.push_back(bitmap); |
| 81 return false; | 81 return false; |
| 82 } | 82 } |
| 83 gpu::Mailbox name; | 83 gpu::Mailbox name; |
| 84 name.SetName(client_mailbox.name); | 84 name.SetName(client_mailbox.name); |
| 85 if (bitmap) | 85 if (bitmap && name.IsZero()) |
|
boliu
2014/01/06 18:16:13
This is patching over another issue which I hacked
| |
| 86 *mailbox = cc::TextureMailbox(bitmap->shared_memory(), bitmap->size()); | 86 *mailbox = cc::TextureMailbox(bitmap->shared_memory(), bitmap->size()); |
| 87 else | 87 else |
| 88 *mailbox = cc::TextureMailbox(name, client_mailbox.syncPoint); | 88 *mailbox = cc::TextureMailbox(name, client_mailbox.syncPoint); |
| 89 | 89 |
| 90 if (mailbox->IsValid()) { | 90 if (mailbox->IsValid()) { |
| 91 *release_callback = cc::SingleReleaseCallback::Create(base::Bind( | 91 *release_callback = cc::SingleReleaseCallback::Create(base::Bind( |
| 92 &WebExternalTextureLayerImpl::DidReleaseMailbox, | 92 &WebExternalTextureLayerImpl::DidReleaseMailbox, |
| 93 this->AsWeakPtr(), | 93 this->AsWeakPtr(), |
| 94 client_mailbox, | 94 client_mailbox, |
| 95 bitmap)); | 95 bitmap)); |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 121 | 121 |
| 122 blink::WebExternalTextureMailbox available_mailbox; | 122 blink::WebExternalTextureMailbox available_mailbox; |
| 123 memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name)); | 123 memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name)); |
| 124 available_mailbox.syncPoint = sync_point; | 124 available_mailbox.syncPoint = sync_point; |
| 125 if (bitmap) | 125 if (bitmap) |
| 126 layer->free_bitmaps_.push_back(bitmap); | 126 layer->free_bitmaps_.push_back(bitmap); |
| 127 layer->client_->mailboxReleased(available_mailbox); | 127 layer->client_->mailboxReleased(available_mailbox); |
| 128 } | 128 } |
| 129 | 129 |
| 130 } // namespace webkit | 130 } // namespace webkit |
| OLD | NEW |