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

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

Issue 1957583002: cc: Add GpuMemoryBufferId to TextureMailbox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unsigned -> signed 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 "Size of web external sync token too small."); 85 "Size of web external sync token too small.");
86 if (client_mailbox.validSyncToken) 86 if (client_mailbox.validSyncToken)
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 = 95 *mailbox = cc::TextureMailbox(
96 cc::TextureMailbox(name, sync_token, client_mailbox.textureTarget, size, 96 name, sync_token, client_mailbox.textureTarget, size,
97 client_mailbox.allowOverlay, false); 97 gfx::GpuMemoryBufferId(client_mailbox.gpuMemoryBufferId),
98 client_mailbox.allowOverlay, false);
98 } 99 }
99 mailbox->set_nearest_neighbor(client_mailbox.nearestNeighbor); 100 mailbox->set_nearest_neighbor(client_mailbox.nearestNeighbor);
100 101
101 if (mailbox->IsValid()) { 102 if (mailbox->IsValid()) {
102 *release_callback = cc::SingleReleaseCallback::Create( 103 *release_callback = cc::SingleReleaseCallback::Create(
103 base::Bind(&WebExternalTextureLayerImpl::DidReleaseMailbox, 104 base::Bind(&WebExternalTextureLayerImpl::DidReleaseMailbox,
104 this->AsWeakPtr(), 105 this->AsWeakPtr(),
105 client_mailbox, 106 client_mailbox,
106 bitmap)); 107 bitmap));
107 } 108 }
(...skipping 24 matching lines...) Expand all
132 memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name)); 133 memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name));
133 memcpy(available_mailbox.syncToken, sync_token.GetConstData(), 134 memcpy(available_mailbox.syncToken, sync_token.GetConstData(),
134 sizeof(sync_token)); 135 sizeof(sync_token));
135 available_mailbox.validSyncToken = sync_token.HasData(); 136 available_mailbox.validSyncToken = sync_token.HasData();
136 if (bitmap) 137 if (bitmap)
137 layer->free_bitmaps_.push_back(base::WrapUnique(bitmap)); 138 layer->free_bitmaps_.push_back(base::WrapUnique(bitmap));
138 layer->client_->mailboxReleased(available_mailbox, lost_resource); 139 layer->client_->mailboxReleased(available_mailbox, lost_resource);
139 } 140 }
140 141
141 } // 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