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

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: Compile errors from rebase, still... 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 | content/test/data/gpu/pixel_canvas2d_webgl.html » ('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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
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;
90 if (client_mailbox.allowOverlay) 90 if (client_mailbox.allowOverlay) {
91 size = gfx::Size(layer_->bounds().width, layer_->bounds().height); 91 size = gfx::Size(client_mailbox.textureSize.width,
92 client_mailbox.textureSize.height);
93 }
92 94
93 *mailbox = 95 *mailbox =
94 cc::TextureMailbox(name, sync_token, client_mailbox.textureTarget, size, 96 cc::TextureMailbox(name, sync_token, client_mailbox.textureTarget, size,
95 client_mailbox.allowOverlay, false); 97 client_mailbox.allowOverlay, false);
96 } 98 }
97 mailbox->set_nearest_neighbor(client_mailbox.nearestNeighbor); 99 mailbox->set_nearest_neighbor(client_mailbox.nearestNeighbor);
98 100
99 if (mailbox->IsValid()) { 101 if (mailbox->IsValid()) {
100 *release_callback = cc::SingleReleaseCallback::Create( 102 *release_callback = cc::SingleReleaseCallback::Create(
101 base::Bind(&WebExternalTextureLayerImpl::DidReleaseMailbox, 103 base::Bind(&WebExternalTextureLayerImpl::DidReleaseMailbox,
(...skipping 28 matching lines...) Expand all
130 memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name)); 132 memcpy(available_mailbox.name, mailbox.name, sizeof(available_mailbox.name));
131 memcpy(available_mailbox.syncToken, sync_token.GetConstData(), 133 memcpy(available_mailbox.syncToken, sync_token.GetConstData(),
132 sizeof(sync_token)); 134 sizeof(sync_token));
133 available_mailbox.validSyncToken = sync_token.HasData(); 135 available_mailbox.validSyncToken = sync_token.HasData();
134 if (bitmap) 136 if (bitmap)
135 layer->free_bitmaps_.push_back(make_scoped_ptr(bitmap)); 137 layer->free_bitmaps_.push_back(make_scoped_ptr(bitmap));
136 layer->client_->mailboxReleased(available_mailbox, lost_resource); 138 layer->client_->mailboxReleased(available_mailbox, lost_resource);
137 } 139 }
138 140
139 } // namespace cc_blink 141 } // namespace cc_blink
OLDNEW
« no previous file with comments | « no previous file | content/test/data/gpu/pixel_canvas2d_webgl.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698