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

Side by Side Diff: components/bitmap_uploader/bitmap_uploader.cc

Issue 2019833002: Implement StructTraits for various cc and gpu types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mailbox_name by ref to make windows happy Created 4 years, 6 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/bitmap_uploader/bitmap_uploader.h" 5 #include "components/bitmap_uploader/bitmap_uploader.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 } 204 }
205 205
206 void BitmapUploader::SetIdNamespace(uint32_t id_namespace) { 206 void BitmapUploader::SetIdNamespace(uint32_t id_namespace) {
207 id_namespace_ = id_namespace; 207 id_namespace_ = id_namespace;
208 if (color_ != g_transparent_color || bitmap_.get()) 208 if (color_ != g_transparent_color || bitmap_.get())
209 Upload(); 209 Upload();
210 } 210 }
211 211
212 void BitmapUploader::OnResourcesReturned( 212 void BitmapUploader::OnResourcesReturned(
213 mus::WindowSurface* surface, 213 mus::WindowSurface* surface,
214 mojo::Array<mus::mojom::ReturnedResourcePtr> resources) { 214 mojo::Array<cc::ReturnedResource> resources) {
215 gpu::gles2::GLES2Interface* gl = gles2_context_->interface(); 215 gpu::gles2::GLES2Interface* gl = gles2_context_->interface();
216 // TODO(jamesr): Recycle. 216 // TODO(jamesr): Recycle.
217 for (size_t i = 0; i < resources.size(); ++i) { 217 for (size_t i = 0; i < resources.size(); ++i) {
218 mus::mojom::ReturnedResourcePtr resource = std::move(resources[i]); 218 cc::ReturnedResource resource = std::move(resources[i]);
219 DCHECK_EQ(1, resource->count); 219 DCHECK_EQ(1, resource.count);
220 gl->WaitSyncTokenCHROMIUM(resource->sync_token.GetConstData()); 220 gl->WaitSyncTokenCHROMIUM(resource.sync_token.GetConstData());
221 uint32_t texture_id = resource_to_texture_id_map_[resource->id]; 221 uint32_t texture_id = resource_to_texture_id_map_[resource.id];
222 DCHECK_NE(0u, texture_id); 222 DCHECK_NE(0u, texture_id);
223 resource_to_texture_id_map_.erase(resource->id); 223 resource_to_texture_id_map_.erase(resource.id);
224 gl->DeleteTextures(1, &texture_id); 224 gl->DeleteTextures(1, &texture_id);
225 } 225 }
226 } 226 }
227 227
228 } // namespace bitmap_uploader 228 } // namespace bitmap_uploader
OLDNEW
« no previous file with comments | « components/bitmap_uploader/bitmap_uploader.h ('k') | components/mus/gpu/display_compositor/compositor_frame_sink_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698