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

Side by Side Diff: components/view_manager/surfaces/surfaces_context_provider.cc

Issue 1189833005: Revert of Support impl-side painting in Mandoline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 "components/view_manager/surfaces/surfaces_context_provider.h" 5 #include "components/view_manager/surfaces/surfaces_context_provider.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "third_party/mojo/src/mojo/public/cpp/environment/environment.h" 8 #include "third_party/mojo/src/mojo/public/cpp/environment/environment.h"
9 9
10 namespace surfaces { 10 namespace surfaces {
11 11
12 SurfacesContextProvider::SurfacesContextProvider( 12 SurfacesContextProvider::SurfacesContextProvider(
13 mojo::ScopedMessagePipeHandle command_buffer_handle) 13 mojo::ScopedMessagePipeHandle command_buffer_handle)
14 : command_buffer_handle_(command_buffer_handle.Pass()), context_(nullptr) { 14 : command_buffer_handle_(command_buffer_handle.Pass()), context_(nullptr) {
15 capabilities_.gpu.image = true;
16 } 15 }
17 16
18 bool SurfacesContextProvider::BindToCurrentThread() { 17 bool SurfacesContextProvider::BindToCurrentThread() {
19 DCHECK(command_buffer_handle_.is_valid()); 18 DCHECK(command_buffer_handle_.is_valid());
20 context_ = MojoGLES2CreateContext(command_buffer_handle_.release().value(), 19 context_ = MojoGLES2CreateContext(command_buffer_handle_.release().value(),
21 &ContextLostThunk, this, 20 &ContextLostThunk, this,
22 mojo::Environment::GetDefaultAsyncWaiter()); 21 mojo::Environment::GetDefaultAsyncWaiter());
23 DCHECK(context_); 22 DCHECK(context_);
24 return !!context_; 23 return !!context_;
25 } 24 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 if (context_) 69 if (context_)
71 MojoGLES2DestroyContext(context_); 70 MojoGLES2DestroyContext(context_);
72 } 71 }
73 72
74 void SurfacesContextProvider::ContextLost() { 73 void SurfacesContextProvider::ContextLost() {
75 if (!lost_context_callback_.is_null()) 74 if (!lost_context_callback_.is_null())
76 lost_context_callback_.Run(); 75 lost_context_callback_.Run();
77 } 76 }
78 77
79 } // namespace surfaces 78 } // namespace surfaces
OLDNEW
« no previous file with comments | « components/view_manager/public/interfaces/command_buffer.mojom ('k') | gpu/command_buffer/build_gles2_cmd_buffer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698