Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(801)

Side by Side Diff: cc/blink/web_external_texture_layer_impl.cc

Issue 1930193002: cc: Add GpuMemoryBufferHandle to TextureMailbox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Trim Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/layers/texture_layer_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 "Size of web external sync token too small."); 86 "Size of web external sync token too small.");
87 if (client_mailbox.validSyncToken) 87 if (client_mailbox.validSyncToken)
88 memcpy(&sync_token, client_mailbox.syncToken, sizeof(sync_token)); 88 memcpy(&sync_token, client_mailbox.syncToken, sizeof(sync_token));
89 89
90 gfx::Size size; 90 gfx::Size size;
91 if (client_mailbox.allowOverlay) { 91 if (client_mailbox.allowOverlay) {
92 size = gfx::Size(client_mailbox.textureSize.width, 92 size = gfx::Size(client_mailbox.textureSize.width,
93 client_mailbox.textureSize.height); 93 client_mailbox.textureSize.height);
94 } 94 }
95 95
96 *mailbox = 96 *mailbox = cc::TextureMailbox(
97 cc::TextureMailbox(name, sync_token, client_mailbox.textureTarget, size, 97 name, sync_token, client_mailbox.textureTarget, size,
98 client_mailbox.allowOverlay, false); 98 gfx::GpuMemoryBufferHandle(), client_mailbox.allowOverlay, false);
ccameron 2016/04/28 23:26:10 For GMBs created in Blink, we will need a way to p
99 } 99 }
100 mailbox->set_nearest_neighbor(client_mailbox.nearestNeighbor); 100 mailbox->set_nearest_neighbor(client_mailbox.nearestNeighbor);
101 101
102 if (mailbox->IsValid()) { 102 if (mailbox->IsValid()) {
103 *release_callback = cc::SingleReleaseCallback::Create( 103 *release_callback = cc::SingleReleaseCallback::Create(
104 base::Bind(&WebExternalTextureLayerImpl::DidReleaseMailbox, 104 base::Bind(&WebExternalTextureLayerImpl::DidReleaseMailbox,
105 this->AsWeakPtr(), 105 this->AsWeakPtr(),
106 client_mailbox, 106 client_mailbox,
107 bitmap)); 107 bitmap));
108 } 108 }
(...skipping 24 matching lines...) Expand all
133 memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name)); 133 memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name));
134 memcpy(available_mailbox.syncToken, sync_token.GetConstData(), 134 memcpy(available_mailbox.syncToken, sync_token.GetConstData(),
135 sizeof(sync_token)); 135 sizeof(sync_token));
136 available_mailbox.validSyncToken = sync_token.HasData(); 136 available_mailbox.validSyncToken = sync_token.HasData();
137 if (bitmap) 137 if (bitmap)
138 layer->free_bitmaps_.push_back(base::WrapUnique(bitmap)); 138 layer->free_bitmaps_.push_back(base::WrapUnique(bitmap));
139 layer->client_->mailboxReleased(available_mailbox, lost_resource); 139 layer->client_->mailboxReleased(available_mailbox, lost_resource);
140 } 140 }
141 141
142 } // namespace cc_blink 142 } // namespace cc_blink
OLDNEW
« no previous file with comments | « no previous file | cc/layers/texture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698