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

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

Issue 1804243002: Re-enable IOSurface Canvas2D. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile error. Created 4 years, 9 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 | third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp » ('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 "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/single_release_callback.h" 10 #include "cc/resources/single_release_callback.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 name.SetName(client_mailbox.name); 79 name.SetName(client_mailbox.name);
80 if (bitmap) { 80 if (bitmap) {
81 *mailbox = cc::TextureMailbox(bitmap->shared_bitmap(), bitmap->size()); 81 *mailbox = cc::TextureMailbox(bitmap->shared_bitmap(), bitmap->size());
82 } else { 82 } else {
83 gpu::SyncToken sync_token; 83 gpu::SyncToken sync_token;
84 static_assert(sizeof(sync_token) <= sizeof(client_mailbox.syncToken), 84 static_assert(sizeof(sync_token) <= sizeof(client_mailbox.syncToken),
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 = gfx::Size(client_mailbox.textureSize.width,
90 if (client_mailbox.allowOverlay) 90 client_mailbox.textureSize.height);
danakj 2016/03/16 01:21:19 https://code.google.com/p/chromium/codesearch#chro
erikchen 2016/03/16 01:33:58 For other onlookers, the comment says: """ // This
danakj 2016/03/16 01:48:25 Well, but what's the point of passing in something
erikchen 2016/03/16 01:55:30 I re-added the conditional """if (client_mailbox.a
91 size = gfx::Size(layer_->bounds().width, layer_->bounds().height);
92 91
93 *mailbox = 92 *mailbox =
94 cc::TextureMailbox(name, sync_token, client_mailbox.textureTarget, size, 93 cc::TextureMailbox(name, sync_token, client_mailbox.textureTarget, size,
95 client_mailbox.allowOverlay, false); 94 client_mailbox.allowOverlay, false);
96 } 95 }
97 mailbox->set_nearest_neighbor(client_mailbox.nearestNeighbor); 96 mailbox->set_nearest_neighbor(client_mailbox.nearestNeighbor);
98 97
99 if (mailbox->IsValid()) { 98 if (mailbox->IsValid()) {
100 *release_callback = cc::SingleReleaseCallback::Create( 99 *release_callback = cc::SingleReleaseCallback::Create(
101 base::Bind(&WebExternalTextureLayerImpl::DidReleaseMailbox, 100 base::Bind(&WebExternalTextureLayerImpl::DidReleaseMailbox,
(...skipping 28 matching lines...) Expand all
130 memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name)); 129 memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name));
131 memcpy(available_mailbox.syncToken, sync_token.GetConstData(), 130 memcpy(available_mailbox.syncToken, sync_token.GetConstData(),
132 sizeof(sync_token)); 131 sizeof(sync_token));
133 available_mailbox.validSyncToken = sync_token.HasData(); 132 available_mailbox.validSyncToken = sync_token.HasData();
134 if (bitmap) 133 if (bitmap)
135 layer->free_bitmaps_.push_back(make_scoped_ptr(bitmap)); 134 layer->free_bitmaps_.push_back(make_scoped_ptr(bitmap));
136 layer->client_->mailboxReleased(available_mailbox, lost_resource); 135 layer->client_->mailboxReleased(available_mailbox, lost_resource);
137 } 136 }
138 137
139 } // namespace cc_blink 138 } // namespace cc_blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698