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

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

Issue 2431753002: Mus experiment in content shell on Android.
Patch Set: Fix mac bot Created 4 years, 1 month 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/BUILD.gn ('k') | services/ui/surfaces/BUILD.gn » ('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/gles2_context.h" 5 #include "services/ui/public/cpp/gles2_context.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 11 matching lines...) Expand all
22 namespace ui { 22 namespace ui {
23 23
24 GLES2Context::GLES2Context() {} 24 GLES2Context::GLES2Context() {}
25 25
26 GLES2Context::~GLES2Context() {} 26 GLES2Context::~GLES2Context() {}
27 27
28 bool GLES2Context::Initialize( 28 bool GLES2Context::Initialize(
29 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, 29 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
30 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { 30 scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
31 DCHECK(gpu_channel_host); 31 DCHECK(gpu_channel_host);
32 gpu::SurfaceHandle surface_handle = gfx::kNullAcceleratedWidget;
33 // TODO(penghuang): support shared group. 32 // TODO(penghuang): support shared group.
34 gpu::CommandBufferProxyImpl* shared_command_buffer = nullptr; 33 gpu::CommandBufferProxyImpl* shared_command_buffer = nullptr;
35 gpu::GpuStreamId stream_id = gpu::GpuStreamId::GPU_STREAM_DEFAULT; 34 gpu::GpuStreamId stream_id = gpu::GpuStreamId::GPU_STREAM_DEFAULT;
36 gpu::GpuStreamPriority stream_priority = gpu::GpuStreamPriority::NORMAL; 35 gpu::GpuStreamPriority stream_priority = gpu::GpuStreamPriority::NORMAL;
37 gpu::gles2::ContextCreationAttribHelper attributes; 36 gpu::gles2::ContextCreationAttribHelper attributes;
38 // TODO(penghuang): figure a useful active_url. 37 // TODO(penghuang): figure a useful active_url.
39 GURL active_url; 38 GURL active_url;
40 command_buffer_proxy_impl_ = gpu::CommandBufferProxyImpl::Create( 39 command_buffer_proxy_impl_ = gpu::CommandBufferProxyImpl::Create(
41 std::move(gpu_channel_host), surface_handle, shared_command_buffer, 40 std::move(gpu_channel_host), gpu::kNullSurfaceHandle,
42 stream_id, stream_priority, attributes, active_url, 41 shared_command_buffer, stream_id, stream_priority, attributes,
43 std::move(task_runner)); 42 active_url, std::move(task_runner));
44 if (!command_buffer_proxy_impl_) 43 if (!command_buffer_proxy_impl_)
45 return false; 44 return false;
46 gpu::CommandBuffer* command_buffer = command_buffer_proxy_impl_.get(); 45 gpu::CommandBuffer* command_buffer = command_buffer_proxy_impl_.get();
47 gpu::GpuControl* gpu_control = command_buffer_proxy_impl_.get(); 46 gpu::GpuControl* gpu_control = command_buffer_proxy_impl_.get();
48 47
49 constexpr gpu::SharedMemoryLimits default_limits; 48 constexpr gpu::SharedMemoryLimits default_limits;
50 gles2_helper_.reset(new gpu::gles2::GLES2CmdHelper(command_buffer)); 49 gles2_helper_.reset(new gpu::gles2::GLES2CmdHelper(command_buffer));
51 if (!gles2_helper_->Initialize(default_limits.command_buffer_size)) 50 if (!gles2_helper_->Initialize(default_limits.command_buffer_size))
52 return false; 51 return false;
53 gles2_helper_->SetAutomaticFlushes(false); 52 gles2_helper_->SetAutomaticFlushes(false);
(...skipping 27 matching lines...) Expand all
81 // Return the GLES2Context only if it is successfully initialized. If 80 // Return the GLES2Context only if it is successfully initialized. If
82 // initialization fails, then return null. 81 // initialization fails, then return null.
83 std::unique_ptr<GLES2Context> gles2_context(new GLES2Context); 82 std::unique_ptr<GLES2Context> gles2_context(new GLES2Context);
84 if (!gles2_context->Initialize(std::move(gpu_channel_host), 83 if (!gles2_context->Initialize(std::move(gpu_channel_host),
85 std::move(task_runner))) 84 std::move(task_runner)))
86 gles2_context.reset(); 85 gles2_context.reset();
87 return gles2_context; 86 return gles2_context;
88 } 87 }
89 88
90 } // namespace ui 89 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/public/cpp/BUILD.gn ('k') | services/ui/surfaces/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698