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

Side by Side Diff: mojo/cc/context_provider_mojo.cc

Issue 1181013010: Support impl-side painting in Mandoline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unittest and android gn build Created 5 years, 6 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 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/cc/context_provider_mojo.h" 5 #include "mojo/cc/context_provider_mojo.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "mojo/gpu/mojo_gles2_impl_autogen.h" 8 #include "mojo/gpu/mojo_gles2_impl_autogen.h"
9 #include "third_party/mojo/src/mojo/public/cpp/environment/environment.h" 9 #include "third_party/mojo/src/mojo/public/cpp/environment/environment.h"
10 10
11 namespace mojo { 11 namespace mojo {
12 12
13 ContextProviderMojo::ContextProviderMojo( 13 ContextProviderMojo::ContextProviderMojo(
14 ScopedMessagePipeHandle command_buffer_handle) 14 ScopedMessagePipeHandle command_buffer_handle)
15 : command_buffer_handle_(command_buffer_handle.Pass()) { 15 : command_buffer_handle_(command_buffer_handle.Pass()) {
16 capabilities_.gpu.image = true;
danakj 2015/06/15 18:20:36 Can you also comment here pointing readers to some
jam 2015/06/15 22:06:01 like what kind of comment? for comparison, content
danakj 2015/06/15 22:11:20 Something like "Enabled the CHROMIUM_image extensi
jam 2015/06/15 22:44:55 Done.
16 } 17 }
17 18
18 bool ContextProviderMojo::BindToCurrentThread() { 19 bool ContextProviderMojo::BindToCurrentThread() {
19 DCHECK(command_buffer_handle_.is_valid()); 20 DCHECK(command_buffer_handle_.is_valid());
20 context_ = MojoGLES2CreateContext(command_buffer_handle_.release().value(), 21 context_ = MojoGLES2CreateContext(command_buffer_handle_.release().value(),
21 &ContextLostThunk, 22 &ContextLostThunk,
22 this, 23 this,
23 Environment::GetDefaultAsyncWaiter()); 24 Environment::GetDefaultAsyncWaiter());
24 context_gl_.reset(new MojoGLES2Impl(context_)); 25 context_gl_.reset(new MojoGLES2Impl(context_));
25 return !!context_; 26 return !!context_;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 ContextProviderMojo::~ContextProviderMojo() { 58 ContextProviderMojo::~ContextProviderMojo() {
58 context_gl_.reset(); 59 context_gl_.reset();
59 if (context_) 60 if (context_)
60 MojoGLES2DestroyContext(context_); 61 MojoGLES2DestroyContext(context_);
61 } 62 }
62 63
63 void ContextProviderMojo::ContextLost() { 64 void ContextProviderMojo::ContextLost() {
64 } 65 }
65 66
66 } // namespace mojo 67 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698