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

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

Issue 2257693002: services/ui: Use a gpu::GpuChannelHost when creating ui::OutputSurface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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
« no previous file with comments | « services/ui/public/cpp/context_provider.h ('k') | services/ui/public/cpp/gles2_context.h » ('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 "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 "gpu/ipc/client/gpu_channel_host.h"
10 #include "services/ui/public/cpp/gles2_context.h" 11 #include "services/ui/public/cpp/gles2_context.h"
11 12
12 namespace ui { 13 namespace ui {
13 14
14 ContextProvider::ContextProvider(GpuService* gpu_service) 15 ContextProvider::ContextProvider(
15 : gpu_service_(gpu_service) {} 16 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host)
17 : gpu_channel_host_(std::move(gpu_channel_host)) {}
16 18
17 bool ContextProvider::BindToCurrentThread() { 19 bool ContextProvider::BindToCurrentThread() {
18 context_ = GLES2Context::CreateOffscreenContext(gpu_service_); 20 context_ = GLES2Context::CreateOffscreenContext(gpu_channel_host_);
19 return !!context_; 21 return !!context_;
20 } 22 }
21 23
22 gpu::gles2::GLES2Interface* ContextProvider::ContextGL() { 24 gpu::gles2::GLES2Interface* ContextProvider::ContextGL() {
23 return context_->interface(); 25 return context_->interface();
24 } 26 }
25 27
26 gpu::ContextSupport* ContextProvider::ContextSupport() { 28 gpu::ContextSupport* ContextProvider::ContextSupport() {
27 if (!context_) 29 if (!context_)
28 return NULL; 30 return NULL;
(...skipping 17 matching lines...) Expand all
46 base::Lock* ContextProvider::GetLock() { 48 base::Lock* ContextProvider::GetLock() {
47 // This context provider is not used on multiple threads. 49 // This context provider is not used on multiple threads.
48 NOTREACHED(); 50 NOTREACHED();
49 return nullptr; 51 return nullptr;
50 } 52 }
51 53
52 ContextProvider::~ContextProvider() { 54 ContextProvider::~ContextProvider() {
53 } 55 }
54 56
55 } // namespace ui 57 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/public/cpp/context_provider.h ('k') | services/ui/public/cpp/gles2_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698