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

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

Issue 1118843003: Remove some InterfacePtr<> methods which directly deal with message pipe handles. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 7 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 | examples/indirect_service/indirect_service_demo.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "examples/bitmap_uploader/bitmap_uploader.h" 5 #include "examples/bitmap_uploader/bitmap_uploader.h"
6 6
7 #ifndef GL_GLEXT_PROTOTYPES 7 #ifndef GL_GLEXT_PROTOTYPES
8 #define GL_GLEXT_PROTOTYPES 8 #define GL_GLEXT_PROTOTYPES
9 #endif // GL_GLEXT_PROTOTYPES 9 #endif // GL_GLEXT_PROTOTYPES
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 returner_binding_.Bind(GetProxy(&returner_ptr)); 54 returner_binding_.Bind(GetProxy(&returner_ptr));
55 surface_->SetResourceReturner(returner_ptr.Pass()); 55 surface_->SetResourceReturner(returner_ptr.Pass());
56 56
57 ServiceProviderPtr gpu_service_provider; 57 ServiceProviderPtr gpu_service_provider;
58 shell->ConnectToApplication("mojo:native_viewport_service", 58 shell->ConnectToApplication("mojo:native_viewport_service",
59 GetProxy(&gpu_service_provider), nullptr); 59 GetProxy(&gpu_service_provider), nullptr);
60 ConnectToService(gpu_service_provider.get(), &gpu_service_); 60 ConnectToService(gpu_service_provider.get(), &gpu_service_);
61 61
62 CommandBufferPtr gles2_client; 62 CommandBufferPtr gles2_client;
63 gpu_service_->CreateOffscreenGLES2Context(GetProxy(&gles2_client)); 63 gpu_service_->CreateOffscreenGLES2Context(GetProxy(&gles2_client));
64 gles2_context_ = 64 gles2_context_ = MojoGLES2CreateContext(
65 MojoGLES2CreateContext(gles2_client.PassMessagePipe().release().value(), 65 gles2_client.PassInterface().PassHandle().release().value(),
66 &LostContext, 66 &LostContext, NULL, Environment::GetDefaultAsyncWaiter());
67 NULL,
68 Environment::GetDefaultAsyncWaiter());
69 MojoGLES2MakeCurrent(gles2_context_); 67 MojoGLES2MakeCurrent(gles2_context_);
70 } 68 }
71 69
72 BitmapUploader::~BitmapUploader() { 70 BitmapUploader::~BitmapUploader() {
73 MojoGLES2DestroyContext(gles2_context_); 71 MojoGLES2DestroyContext(gles2_context_);
74 } 72 }
75 73
76 void BitmapUploader::SetColor(uint32_t color) { 74 void BitmapUploader::SetColor(uint32_t color) {
77 if (color_ == color) 75 if (color_ == color)
78 return; 76 return;
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 0); 265 0);
268 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 266 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
269 return texture; 267 return texture;
270 } 268 }
271 269
272 uint32_t BitmapUploader::TextureFormat() { 270 uint32_t BitmapUploader::TextureFormat() {
273 return format_ == BGRA ? GL_BGRA_EXT : GL_RGBA; 271 return format_ == BGRA ? GL_BGRA_EXT : GL_RGBA;
274 } 272 }
275 273
276 } // namespace mojo 274 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | examples/indirect_service/indirect_service_demo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698