OLD | NEW |
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 Loading... |
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 |
OLD | NEW |