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

Side by Side Diff: components/mus/public/cpp/lib/context_provider.cc

Issue 2007813003: Remove Mojo GLES2 API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 4 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
« no previous file with comments | « components/mus/public/cpp/lib/DEPS ('k') | components/mus/public/cpp/lib/gles2_context.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 "components/mus/public/cpp/context_provider.h" 5 #include "components/mus/public/cpp/context_provider.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "components/mus/public/cpp/gles2_context.h" 10 #include "components/mus/public/cpp/gles2_context.h"
11 11
12 namespace mus { 12 namespace mus {
13 13
14 ContextProvider::ContextProvider( 14 ContextProvider::ContextProvider(
15 mojo::ScopedMessagePipeHandle command_buffer_handle) 15 mojo::ScopedMessagePipeHandle command_buffer_handle)
16 : command_buffer_handle_(std::move(command_buffer_handle)), 16 : command_buffer_handle_(std::move(command_buffer_handle)),
17 context_(nullptr) { 17 context_(nullptr) {
18 } 18 }
19 19
20 bool ContextProvider::BindToCurrentThread() { 20 bool ContextProvider::BindToCurrentThread() {
21 DCHECK(command_buffer_handle_.is_valid());
22 std::unique_ptr<GLES2Context> context(new GLES2Context( 21 std::unique_ptr<GLES2Context> context(new GLES2Context(
23 std::vector<int32_t>(), std::move(command_buffer_handle_), 22 std::vector<int32_t>(), std::move(command_buffer_handle_)));
24 &ContextLostThunk, this));
25 if (context->Initialize()) 23 if (context->Initialize())
26 context_ = std::move(context); 24 context_ = std::move(context);
27 return !!context_; 25 return !!context_;
28 } 26 }
29 27
30 gpu::gles2::GLES2Interface* ContextProvider::ContextGL() { 28 gpu::gles2::GLES2Interface* ContextProvider::ContextGL() {
31 return context_->interface(); 29 return context_->interface();
32 } 30 }
33 31
34 gpu::ContextSupport* ContextProvider::ContextSupport() { 32 gpu::ContextSupport* ContextProvider::ContextSupport() {
(...skipping 18 matching lines...) Expand all
53 51
54 base::Lock* ContextProvider::GetLock() { 52 base::Lock* ContextProvider::GetLock() {
55 // This context provider is not used on multiple threads. 53 // This context provider is not used on multiple threads.
56 NOTREACHED(); 54 NOTREACHED();
57 return nullptr; 55 return nullptr;
58 } 56 }
59 57
60 ContextProvider::~ContextProvider() { 58 ContextProvider::~ContextProvider() {
61 } 59 }
62 60
63 void ContextProvider::ContextLost() {}
64
65 } // namespace mus 61 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/public/cpp/lib/DEPS ('k') | components/mus/public/cpp/lib/gles2_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698