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

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
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 11 matching lines...) Expand all
22 22
23 namespace bitmap_uploader { 23 namespace bitmap_uploader {
24 namespace { 24 namespace {
25 25
26 const uint32_t g_transparent_color = 0x00000000; 26 const uint32_t g_transparent_color = 0x00000000;
27 27
28 void LostContext(void*) { 28 void LostContext(void*) {
29 // TODO(fsamuel): Figure out if there's something useful to do here. 29 // TODO(fsamuel): Figure out if there's something useful to do here.
30 } 30 }
31 31
32 void OnGotContentHandlerID(uint32_t content_handler_id) {} 32 void OnGotRemoteIDs(uint32_t remote_id, uint32_t content_handler_id) {}
33 33
34 } // namespace 34 } // namespace
35 35
36 const char kBitmapUploaderForAcceleratedWidget[] = 36 const char kBitmapUploaderForAcceleratedWidget[] =
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),
(...skipping 11 matching lines...) Expand all
54 void BitmapUploader::Init(mojo::Shell* shell) { 54 void BitmapUploader::Init(mojo::Shell* shell) {
55 surface_ = window_->RequestSurface(mus::mojom::SURFACE_TYPE_DEFAULT); 55 surface_ = window_->RequestSurface(mus::mojom::SURFACE_TYPE_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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 glWaitSyncTokenCHROMIUM( 257 glWaitSyncTokenCHROMIUM(
258 resource->sync_token.To<gpu::SyncToken>().GetConstData()); 258 resource->sync_token.To<gpu::SyncToken>().GetConstData());
259 uint32_t texture_id = resource_to_texture_id_map_[resource->id]; 259 uint32_t texture_id = resource_to_texture_id_map_[resource->id];
260 DCHECK_NE(0u, texture_id); 260 DCHECK_NE(0u, texture_id);
261 resource_to_texture_id_map_.erase(resource->id); 261 resource_to_texture_id_map_.erase(resource->id);
262 glDeleteTextures(1, &texture_id); 262 glDeleteTextures(1, &texture_id);
263 } 263 }
264 } 264 }
265 265
266 } // namespace bitmap_uploader 266 } // namespace bitmap_uploader
OLDNEW
« no previous file with comments | « no previous file | components/html_viewer/media_factory.cc » ('j') | mojo/shell/public/interfaces/application.mojom » ('J')

Powered by Google App Engine
This is Rietveld 408576698