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

Side by Side Diff: services/ui/public/cpp/lib/context_provider.cc

Issue 2187103002: services/ui: Remove unused connector argument (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build errors Created 4 years, 4 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 "services/ui/public/cpp/context_provider.h" 5 #include "services/ui/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 "services/shell/public/cpp/connector.h"
11 #include "services/ui/public/cpp/gles2_context.h" 10 #include "services/ui/public/cpp/gles2_context.h"
12 11
13 namespace ui { 12 namespace ui {
14 13
15 ContextProvider::ContextProvider(shell::Connector* connector) 14 ContextProvider::ContextProvider() {}
16 : connector_(connector->Clone()) {}
17 15
18 bool ContextProvider::BindToCurrentThread() { 16 bool ContextProvider::BindToCurrentThread() {
19 if (connector_) { 17 context_ = GLES2Context::CreateOffscreenContext(std::vector<int32_t>());
20 context_ = GLES2Context::CreateOffscreenContext(std::vector<int32_t>(),
21 connector_.get());
22 // We don't need the connector anymore, so release it.
23 connector_.reset();
24 }
25 return !!context_; 18 return !!context_;
26 } 19 }
27 20
28 gpu::gles2::GLES2Interface* ContextProvider::ContextGL() { 21 gpu::gles2::GLES2Interface* ContextProvider::ContextGL() {
29 return context_->interface(); 22 return context_->interface();
30 } 23 }
31 24
32 gpu::ContextSupport* ContextProvider::ContextSupport() { 25 gpu::ContextSupport* ContextProvider::ContextSupport() {
33 if (!context_) 26 if (!context_)
34 return NULL; 27 return NULL;
(...skipping 17 matching lines...) Expand all
52 base::Lock* ContextProvider::GetLock() { 45 base::Lock* ContextProvider::GetLock() {
53 // This context provider is not used on multiple threads. 46 // This context provider is not used on multiple threads.
54 NOTREACHED(); 47 NOTREACHED();
55 return nullptr; 48 return nullptr;
56 } 49 }
57 50
58 ContextProvider::~ContextProvider() { 51 ContextProvider::~ContextProvider() {
59 } 52 }
60 53
61 } // namespace ui 54 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/public/cpp/lib/bitmap_uploader.cc ('k') | services/ui/public/cpp/lib/gles2_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698