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 "cc/blink/web_external_bitmap_impl.h" | 7 #include "cc/blink/web_external_bitmap_impl.h" |
8 #include "cc/blink/web_layer_impl.h" | 8 #include "cc/blink/web_layer_impl.h" |
9 #include "cc/layers/texture_layer.h" | 9 #include "cc/layers/texture_layer.h" |
10 #include "cc/resources/resource_update_queue.h" | 10 #include "cc/resources/resource_update_queue.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 if (!client_->prepareMailbox(&client_mailbox, bitmap)) { | 80 if (!client_->prepareMailbox(&client_mailbox, bitmap)) { |
81 if (bitmap) | 81 if (bitmap) |
82 free_bitmaps_.push_back(bitmap); | 82 free_bitmaps_.push_back(bitmap); |
83 return false; | 83 return false; |
84 } | 84 } |
85 gpu::Mailbox name; | 85 gpu::Mailbox name; |
86 name.SetName(client_mailbox.name); | 86 name.SetName(client_mailbox.name); |
87 if (bitmap) { | 87 if (bitmap) { |
88 *mailbox = cc::TextureMailbox(bitmap->shared_bitmap(), bitmap->size()); | 88 *mailbox = cc::TextureMailbox(bitmap->shared_bitmap(), bitmap->size()); |
89 } else { | 89 } else { |
90 *mailbox = | 90 *mailbox = cc::TextureMailbox(name, GL_TEXTURE_2D, client_mailbox.syncPoint, |
91 cc::TextureMailbox(name, GL_TEXTURE_2D, client_mailbox.syncPoint); | 91 gfx::Size(), client_mailbox.allowOverlay); |
danakj
2015/05/29 20:04:14
TODO to pass a valid size and DCHECK allowOverlay
achaulk
2015/06/01 15:43:10
Done.
| |
92 } | 92 } |
93 mailbox->set_allow_overlay(client_mailbox.allowOverlay); | |
94 mailbox->set_nearest_neighbor(client_mailbox.nearestNeighbor); | 93 mailbox->set_nearest_neighbor(client_mailbox.nearestNeighbor); |
95 | 94 |
96 if (mailbox->IsValid()) { | 95 if (mailbox->IsValid()) { |
97 *release_callback = cc::SingleReleaseCallback::Create( | 96 *release_callback = cc::SingleReleaseCallback::Create( |
98 base::Bind(&WebExternalTextureLayerImpl::DidReleaseMailbox, | 97 base::Bind(&WebExternalTextureLayerImpl::DidReleaseMailbox, |
99 this->AsWeakPtr(), | 98 this->AsWeakPtr(), |
100 client_mailbox, | 99 client_mailbox, |
101 bitmap)); | 100 bitmap)); |
102 } | 101 } |
103 | 102 |
(...skipping 19 matching lines...) Expand all Loading... | |
123 DCHECK(layer); | 122 DCHECK(layer); |
124 blink::WebExternalTextureMailbox available_mailbox; | 123 blink::WebExternalTextureMailbox available_mailbox; |
125 memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name)); | 124 memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name)); |
126 available_mailbox.syncPoint = sync_point; | 125 available_mailbox.syncPoint = sync_point; |
127 if (bitmap) | 126 if (bitmap) |
128 layer->free_bitmaps_.push_back(bitmap); | 127 layer->free_bitmaps_.push_back(bitmap); |
129 layer->client_->mailboxReleased(available_mailbox, lost_resource); | 128 layer->client_->mailboxReleased(available_mailbox, lost_resource); |
130 } | 129 } |
131 | 130 |
132 } // namespace cc_blink | 131 } // namespace cc_blink |
OLD | NEW |