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

Unified Diff: cc/blink/web_external_texture_layer_impl.cc

Issue 1427543002: Modified old wait sync point functions to also accept new sync tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: format Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/blink/web_external_texture_layer_impl.h ('k') | cc/layers/texture_layer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/blink/web_external_texture_layer_impl.cc
diff --git a/cc/blink/web_external_texture_layer_impl.cc b/cc/blink/web_external_texture_layer_impl.cc
index acc7df44e6382b2a6ee1198c09ceb50bace135bd..92414a90a6b6acf7289fdca97f5edfccf841f3d4 100644
--- a/cc/blink/web_external_texture_layer_impl.cc
+++ b/cc/blink/web_external_texture_layer_impl.cc
@@ -81,9 +81,15 @@ bool WebExternalTextureLayerImpl::PrepareTextureMailbox(
if (bitmap) {
*mailbox = cc::TextureMailbox(bitmap->shared_bitmap(), bitmap->size());
} else {
+ gpu::SyncToken sync_token;
+ static_assert(sizeof(sync_token) <= sizeof(client_mailbox.syncToken),
+ "Size of web external sync token too small.");
+ if (client_mailbox.validSyncToken)
+ memcpy(&sync_token, client_mailbox.syncToken, sizeof(sync_token));
+
// TODO(achaulk): pass a valid size here if allowOverlay is set.
- *mailbox = cc::TextureMailbox(name, GL_TEXTURE_2D, client_mailbox.syncPoint,
- gfx::Size(), client_mailbox.allowOverlay);
+ *mailbox = cc::TextureMailbox(name, sync_token, GL_TEXTURE_2D, gfx::Size(),
+ client_mailbox.allowOverlay);
}
mailbox->set_nearest_neighbor(client_mailbox.nearestNeighbor);
@@ -112,12 +118,16 @@ void WebExternalTextureLayerImpl::DidReleaseMailbox(
base::WeakPtr<WebExternalTextureLayerImpl> layer,
const blink::WebExternalTextureMailbox& mailbox,
WebExternalBitmapImpl* bitmap,
- unsigned sync_point,
+ const gpu::SyncToken& sync_token,
bool lost_resource) {
DCHECK(layer);
blink::WebExternalTextureMailbox available_mailbox;
+ static_assert(sizeof(sync_token) <= sizeof(available_mailbox.syncToken),
+ "Size of web external sync token too small.");
memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name));
- available_mailbox.syncPoint = sync_point;
+ memcpy(available_mailbox.syncToken, sync_token.GetConstData(),
+ sizeof(sync_token));
+ available_mailbox.validSyncToken = sync_token.HasData();
if (bitmap)
layer->free_bitmaps_.push_back(bitmap);
layer->client_->mailboxReleased(available_mailbox, lost_resource);
« no previous file with comments | « cc/blink/web_external_texture_layer_impl.h ('k') | cc/layers/texture_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698