OLD | NEW |
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 "mojo/services/public/cpp/view_manager/lib/bitmap_uploader.h" | 5 #include "mojo/services/public/cpp/view_manager/lib/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 30 matching lines...) Expand all Loading... |
41 : client_(client), | 41 : client_(client), |
42 view_id_(view_id), | 42 view_id_(view_id), |
43 surfaces_service_(surfaces_service.Pass()), | 43 surfaces_service_(surfaces_service.Pass()), |
44 gpu_service_(gpu_service.Pass()), | 44 gpu_service_(gpu_service.Pass()), |
45 color_(SK_ColorTRANSPARENT), | 45 color_(SK_ColorTRANSPARENT), |
46 next_resource_id_(1u), | 46 next_resource_id_(1u), |
47 weak_factory_(this) { | 47 weak_factory_(this) { |
48 surfaces_service_->CreateSurfaceConnection(base::Bind( | 48 surfaces_service_->CreateSurfaceConnection(base::Bind( |
49 &BitmapUploader::OnSurfaceConnectionCreated, weak_factory_.GetWeakPtr())); | 49 &BitmapUploader::OnSurfaceConnectionCreated, weak_factory_.GetWeakPtr())); |
50 CommandBufferPtr gles2_client; | 50 CommandBufferPtr gles2_client; |
51 gpu_service_->CreateOffscreenGLES2Context(Get(&gles2_client)); | 51 gpu_service_->CreateOffscreenGLES2Context(GetProxy(&gles2_client)); |
52 gles2_context_ = | 52 gles2_context_ = |
53 MojoGLES2CreateContext(gles2_client.PassMessagePipe().release().value(), | 53 MojoGLES2CreateContext(gles2_client.PassMessagePipe().release().value(), |
54 &LostContext, | 54 &LostContext, |
55 NULL, | 55 NULL, |
56 Environment::GetDefaultAsyncWaiter()); | 56 Environment::GetDefaultAsyncWaiter()); |
57 MojoGLES2MakeCurrent(gles2_context_); | 57 MojoGLES2MakeCurrent(gles2_context_); |
58 } | 58 } |
59 | 59 |
60 BitmapUploader::~BitmapUploader() { | 60 BitmapUploader::~BitmapUploader() { |
61 MojoGLES2DestroyContext(gles2_context_); | 61 MojoGLES2DestroyContext(gles2_context_); |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 size.height(), | 223 size.height(), |
224 0, | 224 0, |
225 TextureFormat(), | 225 TextureFormat(), |
226 GL_UNSIGNED_BYTE, | 226 GL_UNSIGNED_BYTE, |
227 0); | 227 0); |
228 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); | 228 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
229 return texture; | 229 return texture; |
230 } | 230 } |
231 | 231 |
232 } // namespace mojo | 232 } // namespace mojo |
OLD | NEW |