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

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

Issue 2107783003: Pass initial size and GPU preference via context attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gyp fix 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;
43 42
44 std::unique_ptr<gpu::GLInProcessContext> context = 43 std::unique_ptr<gpu::GLInProcessContext> context =
45 base::WrapUnique(gpu::GLInProcessContext::Create( 44 base::WrapUnique(gpu::GLInProcessContext::Create(
46 nullptr, nullptr, is_offscreen, gfx::kNullAcceleratedWidget, 45 nullptr, nullptr, is_offscreen, gfx::kNullAcceleratedWidget,
47 gfx::Size(1, 1), shared_context, attribs, gpu_preference, 46 shared_context, attribs, gpu::SharedMemoryLimits(),
48 gpu::SharedMemoryLimits(), gpu_memory_buffer_manager, image_factory)); 47 gpu_memory_buffer_manager, image_factory));
49 48
50 DCHECK(context); 49 DCHECK(context);
51 return context; 50 return context;
52 } 51 }
53 52
54 std::unique_ptr<gpu::GLInProcessContext> CreateTestInProcessContext() { 53 std::unique_ptr<gpu::GLInProcessContext> CreateTestInProcessContext() {
55 return CreateTestInProcessContext(nullptr, nullptr, nullptr); 54 return CreateTestInProcessContext(nullptr, nullptr, nullptr);
56 } 55 }
57 56
58 TestInProcessContextProvider::TestInProcessContextProvider( 57 TestInProcessContextProvider::TestInProcessContextProvider(
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 111
113 void TestInProcessContextProvider::DeleteCachedResources() { 112 void TestInProcessContextProvider::DeleteCachedResources() {
114 if (gr_context_) 113 if (gr_context_)
115 gr_context_->FreeGpuResources(); 114 gr_context_->FreeGpuResources();
116 } 115 }
117 116
118 void TestInProcessContextProvider::SetLostContextCallback( 117 void TestInProcessContextProvider::SetLostContextCallback(
119 const LostContextCallback& lost_context_callback) {} 118 const LostContextCallback& lost_context_callback) {}
120 119
121 } // namespace cc 120 } // 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