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

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

Issue 1578473002: Pass application ids via AcceptConnection & ConnectToApplication callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 11 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 | components/font_service/public/cpp/font_loader.cc » ('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 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 12 matching lines...) Expand all
23 23
24 namespace bitmap_uploader { 24 namespace bitmap_uploader {
25 namespace { 25 namespace {
26 26
27 const uint32_t g_transparent_color = 0x00000000; 27 const uint32_t g_transparent_color = 0x00000000;
28 28
29 void LostContext(void*) { 29 void LostContext(void*) {
30 // TODO(fsamuel): Figure out if there's something useful to do here. 30 // TODO(fsamuel): Figure out if there's something useful to do here.
31 } 31 }
32 32
33 void OnGotContentHandlerID(uint32_t content_handler_id) {} 33 void OnGotRemoteIDs(uint32_t remote_id, uint32_t content_handler_id) {}
34 34
35 } // namespace 35 } // namespace
36 36
37 const char kBitmapUploaderForAcceleratedWidget[] = 37 const char kBitmapUploaderForAcceleratedWidget[] =
38 "__BITMAP_UPLOADER_ACCELERATED_WIDGET__"; 38 "__BITMAP_UPLOADER_ACCELERATED_WIDGET__";
39 39
40 BitmapUploader::BitmapUploader(mus::Window* window) 40 BitmapUploader::BitmapUploader(mus::Window* window)
41 : window_(window), 41 : window_(window),
42 color_(g_transparent_color), 42 color_(g_transparent_color),
43 width_(0), 43 width_(0),
(...skipping 10 matching lines...) Expand all
54 void BitmapUploader::Init(mojo::Shell* shell) { 54 void BitmapUploader::Init(mojo::Shell* shell) {
55 surface_ = window_->RequestSurface(mus::mojom::SurfaceType::DEFAULT); 55 surface_ = window_->RequestSurface(mus::mojom::SurfaceType::DEFAULT);
56 surface_->BindToThread(); 56 surface_->BindToThread();
57 57
58 mojo::ServiceProviderPtr gpu_service_provider; 58 mojo::ServiceProviderPtr gpu_service_provider;
59 mojo::URLRequestPtr request2(mojo::URLRequest::New()); 59 mojo::URLRequestPtr request2(mojo::URLRequest::New());
60 request2->url = mojo::String::From("mojo:mus"); 60 request2->url = mojo::String::From("mojo:mus");
61 shell->ConnectToApplication(std::move(request2), 61 shell->ConnectToApplication(std::move(request2),
62 mojo::GetProxy(&gpu_service_provider), nullptr, 62 mojo::GetProxy(&gpu_service_provider), nullptr,
63 mojo::CreatePermissiveCapabilityFilter(), 63 mojo::CreatePermissiveCapabilityFilter(),
64 base::Bind(&OnGotContentHandlerID)); 64 base::Bind(&OnGotRemoteIDs));
65 ConnectToService(gpu_service_provider.get(), &gpu_service_); 65 ConnectToService(gpu_service_provider.get(), &gpu_service_);
66 66
67 mus::mojom::CommandBufferPtr gles2_client; 67 mus::mojom::CommandBufferPtr gles2_client;
68 gpu_service_->CreateOffscreenGLES2Context(GetProxy(&gles2_client)); 68 gpu_service_->CreateOffscreenGLES2Context(GetProxy(&gles2_client));
69 gles2_context_ = MojoGLES2CreateContext( 69 gles2_context_ = MojoGLES2CreateContext(
70 gles2_client.PassInterface().PassHandle().release().value(), 70 gles2_client.PassInterface().PassHandle().release().value(),
71 nullptr, 71 nullptr,
72 &LostContext, nullptr, mojo::Environment::GetDefaultAsyncWaiter()); 72 &LostContext, nullptr, mojo::Environment::GetDefaultAsyncWaiter());
73 MojoGLES2MakeCurrent(gles2_context_); 73 MojoGLES2MakeCurrent(gles2_context_);
74 } 74 }
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 glWaitSyncTokenCHROMIUM( 262 glWaitSyncTokenCHROMIUM(
263 resource->sync_token.To<gpu::SyncToken>().GetConstData()); 263 resource->sync_token.To<gpu::SyncToken>().GetConstData());
264 uint32_t texture_id = resource_to_texture_id_map_[resource->id]; 264 uint32_t texture_id = resource_to_texture_id_map_[resource->id];
265 DCHECK_NE(0u, texture_id); 265 DCHECK_NE(0u, texture_id);
266 resource_to_texture_id_map_.erase(resource->id); 266 resource_to_texture_id_map_.erase(resource->id);
267 glDeleteTextures(1, &texture_id); 267 glDeleteTextures(1, &texture_id);
268 } 268 }
269 } 269 }
270 270
271 } // namespace bitmap_uploader 271 } // namespace bitmap_uploader
OLDNEW
« no previous file with comments | « no previous file | components/font_service/public/cpp/font_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698