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

Side by Side Diff: content/browser/gpu/gpu_ipc_browsertests.cc

Issue 2881813002: Revert of gpu: GPU service scheduler. (Closed)
Patch Set: Created 3 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/memory/ptr_util.h" 6 #include "base/memory/ptr_util.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "content/browser/compositor/image_transport_factory.h" 9 #include "content/browser/compositor/image_transport_factory.h"
10 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" 10 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
11 #include "content/browser/gpu/gpu_process_host.h" 11 #include "content/browser/gpu/gpu_process_host.h"
12 #include "content/common/gpu_stream_constants.h"
13 #include "content/public/browser/gpu_data_manager.h" 12 #include "content/public/browser/gpu_data_manager.h"
14 #include "content/public/browser/gpu_utils.h" 13 #include "content/public/browser/gpu_utils.h"
15 #include "content/public/common/content_switches.h" 14 #include "content/public/common/content_switches.h"
16 #include "content/public/test/content_browser_test.h" 15 #include "content/public/test/content_browser_test.h"
17 #include "services/ui/gpu/interfaces/gpu_service.mojom.h" 16 #include "services/ui/gpu/interfaces/gpu_service.mojom.h"
18 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h" 17 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h"
19 #include "third_party/skia/include/core/SkCanvas.h" 18 #include "third_party/skia/include/core/SkCanvas.h"
20 #include "third_party/skia/include/core/SkPaint.h" 19 #include "third_party/skia/include/core/SkPaint.h"
21 #include "third_party/skia/include/core/SkSurface.h" 20 #include "third_party/skia/include/core/SkSurface.h"
22 #include "third_party/skia/include/gpu/GrContext.h" 21 #include "third_party/skia/include/gpu/GrContext.h"
23 #include "ui/gl/gl_switches.h" 22 #include "ui/gl/gl_switches.h"
24 23
25 namespace { 24 namespace {
26 25
27 scoped_refptr<ui::ContextProviderCommandBuffer> CreateContext( 26 scoped_refptr<ui::ContextProviderCommandBuffer> CreateContext(
28 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host) { 27 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host) {
29 // This is for an offscreen context, so the default framebuffer doesn't need 28 // This is for an offscreen context, so the default framebuffer doesn't need
30 // any alpha, depth, stencil, antialiasing. 29 // any alpha, depth, stencil, antialiasing.
31 gpu::gles2::ContextCreationAttribHelper attributes; 30 gpu::gles2::ContextCreationAttribHelper attributes;
32 attributes.alpha_size = -1; 31 attributes.alpha_size = -1;
33 attributes.depth_size = 0; 32 attributes.depth_size = 0;
34 attributes.stencil_size = 0; 33 attributes.stencil_size = 0;
35 attributes.samples = 0; 34 attributes.samples = 0;
36 attributes.sample_buffers = 0; 35 attributes.sample_buffers = 0;
37 attributes.bind_generates_resource = false; 36 attributes.bind_generates_resource = false;
38 constexpr bool automatic_flushes = false; 37 constexpr bool automatic_flushes = false;
39 constexpr bool support_locking = false; 38 constexpr bool support_locking = false;
40 return make_scoped_refptr(new ui::ContextProviderCommandBuffer( 39 return make_scoped_refptr(new ui::ContextProviderCommandBuffer(
41 std::move(gpu_channel_host), content::kGpuStreamIdDefault, 40 std::move(gpu_channel_host), gpu::GPU_STREAM_DEFAULT,
42 content::kGpuStreamPriorityDefault, gpu::kNullSurfaceHandle, GURL(), 41 gpu::GpuStreamPriority::NORMAL, gpu::kNullSurfaceHandle, GURL(),
43 automatic_flushes, support_locking, gpu::SharedMemoryLimits(), attributes, 42 automatic_flushes, support_locking, gpu::SharedMemoryLimits(), attributes,
44 nullptr, ui::command_buffer_metrics::OFFSCREEN_CONTEXT_FOR_TESTING)); 43 nullptr, ui::command_buffer_metrics::OFFSCREEN_CONTEXT_FOR_TESTING));
45 } 44 }
46 45
47 void OnEstablishedGpuChannel( 46 void OnEstablishedGpuChannel(
48 const base::Closure& quit_closure, 47 const base::Closure& quit_closure,
49 scoped_refptr<gpu::GpuChannelHost>* retvalue, 48 scoped_refptr<gpu::GpuChannelHost>* retvalue,
50 scoped_refptr<gpu::GpuChannelHost> established_host) { 49 scoped_refptr<gpu::GpuChannelHost> established_host) {
51 if (retvalue) 50 if (retvalue)
52 *retvalue = std::move(established_host); 51 *retvalue = std::move(established_host);
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 303
305 IN_PROC_BROWSER_TEST_F(GpuProcessHostBrowserTest, Shutdown) { 304 IN_PROC_BROWSER_TEST_F(GpuProcessHostBrowserTest, Shutdown) {
306 DCHECK(!IsChannelEstablished()); 305 DCHECK(!IsChannelEstablished());
307 EstablishAndWait(); 306 EstablishAndWait();
308 base::RunLoop run_loop; 307 base::RunLoop run_loop;
309 StopGpuProcess(run_loop.QuitClosure()); 308 StopGpuProcess(run_loop.QuitClosure());
310 run_loop.Run(); 309 run_loop.Run();
311 } 310 }
312 311
313 } // namespace content 312 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/compositor_util.cc ('k') | content/browser/renderer_host/compositor_impl_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698