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 26 matching lines...) Expand all Loading... |
37 "__BITMAP_UPLOADER_ACCELERATED_WIDGET__"; | 37 "__BITMAP_UPLOADER_ACCELERATED_WIDGET__"; |
38 | 38 |
39 BitmapUploader::BitmapUploader(mus::Window* window) | 39 BitmapUploader::BitmapUploader(mus::Window* window) |
40 : window_(window), | 40 : window_(window), |
41 color_(g_transparent_color), | 41 color_(g_transparent_color), |
42 width_(0), | 42 width_(0), |
43 height_(0), | 43 height_(0), |
44 format_(BGRA), | 44 format_(BGRA), |
45 next_resource_id_(1u), | 45 next_resource_id_(1u), |
46 id_namespace_(0u), | 46 id_namespace_(0u), |
47 local_id_(0u), | |
48 surface_client_binding_(this) {} | 47 surface_client_binding_(this) {} |
49 | 48 |
50 BitmapUploader::~BitmapUploader() { | 49 BitmapUploader::~BitmapUploader() { |
51 MojoGLES2DestroyContext(gles2_context_); | 50 MojoGLES2DestroyContext(gles2_context_); |
52 } | 51 } |
53 | 52 |
54 void BitmapUploader::Init(mojo::Shell* shell) { | 53 void BitmapUploader::Init(mojo::Shell* shell) { |
55 surface_ = window_->RequestSurface(mus::mojom::SURFACE_TYPE_DEFAULT); | 54 surface_ = window_->RequestSurface(mus::mojom::SURFACE_TYPE_DEFAULT); |
56 surface_->BindToThread(); | 55 surface_->BindToThread(); |
57 | 56 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 glWaitSyncTokenCHROMIUM( | 256 glWaitSyncTokenCHROMIUM( |
258 resource->sync_token.To<gpu::SyncToken>().GetConstData()); | 257 resource->sync_token.To<gpu::SyncToken>().GetConstData()); |
259 uint32_t texture_id = resource_to_texture_id_map_[resource->id]; | 258 uint32_t texture_id = resource_to_texture_id_map_[resource->id]; |
260 DCHECK_NE(0u, texture_id); | 259 DCHECK_NE(0u, texture_id); |
261 resource_to_texture_id_map_.erase(resource->id); | 260 resource_to_texture_id_map_.erase(resource->id); |
262 glDeleteTextures(1, &texture_id); | 261 glDeleteTextures(1, &texture_id); |
263 } | 262 } |
264 } | 263 } |
265 | 264 |
266 } // namespace bitmap_uploader | 265 } // namespace bitmap_uploader |
OLD | NEW |