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

Side by Side Diff: cc/test/test_in_process_context_provider.cc

Issue 2106103005: Revert of Pass initial size and GPU preference via context attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 "cc/test/test_in_process_context_provider.h" 5 #include "cc/test/test_in_process_context_provider.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 21 matching lines...) Expand all
32 gpu::GLInProcessContext* shared_context) { 32 gpu::GLInProcessContext* shared_context) {
33 const bool is_offscreen = true; 33 const bool is_offscreen = true;
34 gpu::gles2::ContextCreationAttribHelper attribs; 34 gpu::gles2::ContextCreationAttribHelper attribs;
35 attribs.alpha_size = -1; 35 attribs.alpha_size = -1;
36 attribs.depth_size = 24; 36 attribs.depth_size = 24;
37 attribs.stencil_size = 8; 37 attribs.stencil_size = 8;
38 attribs.samples = 0; 38 attribs.samples = 0;
39 attribs.sample_buffers = 0; 39 attribs.sample_buffers = 0;
40 attribs.fail_if_major_perf_caveat = false; 40 attribs.fail_if_major_perf_caveat = false;
41 attribs.bind_generates_resource = false; 41 attribs.bind_generates_resource = false;
42 gl::GpuPreference gpu_preference = gl::PreferDiscreteGpu;
42 43
43 std::unique_ptr<gpu::GLInProcessContext> context = 44 std::unique_ptr<gpu::GLInProcessContext> context =
44 base::WrapUnique(gpu::GLInProcessContext::Create( 45 base::WrapUnique(gpu::GLInProcessContext::Create(
45 nullptr, nullptr, is_offscreen, gfx::kNullAcceleratedWidget, 46 nullptr, nullptr, is_offscreen, gfx::kNullAcceleratedWidget,
46 shared_context, attribs, gpu::SharedMemoryLimits(), 47 gfx::Size(1, 1), shared_context, attribs, gpu_preference,
47 gpu_memory_buffer_manager, image_factory)); 48 gpu::SharedMemoryLimits(), gpu_memory_buffer_manager, image_factory));
48 49
49 DCHECK(context); 50 DCHECK(context);
50 return context; 51 return context;
51 } 52 }
52 53
53 std::unique_ptr<gpu::GLInProcessContext> CreateTestInProcessContext() { 54 std::unique_ptr<gpu::GLInProcessContext> CreateTestInProcessContext() {
54 return CreateTestInProcessContext(nullptr, nullptr, nullptr); 55 return CreateTestInProcessContext(nullptr, nullptr, nullptr);
55 } 56 }
56 57
57 TestInProcessContextProvider::TestInProcessContextProvider( 58 TestInProcessContextProvider::TestInProcessContextProvider(
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 112
112 void TestInProcessContextProvider::DeleteCachedResources() { 113 void TestInProcessContextProvider::DeleteCachedResources() {
113 if (gr_context_) 114 if (gr_context_)
114 gr_context_->FreeGpuResources(); 115 gr_context_->FreeGpuResources();
115 } 116 }
116 117
117 void TestInProcessContextProvider::SetLostContextCallback( 118 void TestInProcessContextProvider::SetLostContextCallback(
118 const LostContextCallback& lost_context_callback) {} 119 const LostContextCallback& lost_context_callback) {}
119 120
120 } // namespace cc 121 } // namespace cc
OLDNEW
« no previous file with comments | « blimp/client/feature/compositor/blimp_context_provider.cc ('k') | components/display_compositor/gl_helper_benchmark.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698