OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file looks like a unit test, but it contains benchmarks and test | 5 // This file looks like a unit test, but it contains benchmarks and test |
6 // utilities intended for manual evaluation of the scalers in | 6 // utilities intended for manual evaluation of the scalers in |
7 // gl_helper*. These tests produce output in the form of files and printouts, | 7 // gl_helper*. These tests produce output in the form of files and printouts, |
8 // but cannot really "fail". There is no point in making these tests part | 8 // but cannot really "fail". There is no point in making these tests part |
9 // of any test automation run. | 9 // of any test automation run. |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 attributes.depth_size = 24; | 60 attributes.depth_size = 24; |
61 attributes.red_size = 8; | 61 attributes.red_size = 8; |
62 attributes.green_size = 8; | 62 attributes.green_size = 8; |
63 attributes.blue_size = 8; | 63 attributes.blue_size = 8; |
64 attributes.stencil_size = 8; | 64 attributes.stencil_size = 8; |
65 attributes.samples = 4; | 65 attributes.samples = 4; |
66 attributes.sample_buffers = 1; | 66 attributes.sample_buffers = 1; |
67 attributes.bind_generates_resource = false; | 67 attributes.bind_generates_resource = false; |
68 attributes.gpu_preference = gl::PreferDiscreteGpu; | 68 attributes.gpu_preference = gl::PreferDiscreteGpu; |
69 | 69 |
70 context_.reset(gpu::GLInProcessContext::Create( | 70 context_.reset( |
71 nullptr, /* service */ | 71 gpu::GLInProcessContext::Create(nullptr, /* service */ |
72 nullptr, /* surface */ | 72 nullptr, /* surface */ |
73 true, /* offscreen */ | 73 true, /* offscreen */ |
74 gfx::kNullAcceleratedWidget, /* window */ | 74 gpu::kNullSurfaceHandle, /* window */ |
75 nullptr, /* share_context */ | 75 nullptr, /* share_context */ |
76 attributes, gpu::SharedMemoryLimits(), | 76 attributes, gpu::SharedMemoryLimits(), |
77 nullptr, /* gpu_memory_buffer_manager */ | 77 nullptr, /* gpu_memory_buffer_manager */ |
78 nullptr, /* image_factory */ | 78 nullptr, /* image_factory */ |
79 base::ThreadTaskRunnerHandle::Get())); | 79 base::ThreadTaskRunnerHandle::Get())); |
80 gl_ = context_->GetImplementation(); | 80 gl_ = context_->GetImplementation(); |
81 gpu::ContextSupport* support = context_->GetImplementation(); | 81 gpu::ContextSupport* support = context_->GetImplementation(); |
82 | 82 |
83 helper_.reset(new display_compositor::GLHelper(gl_, support)); | 83 helper_.reset(new display_compositor::GLHelper(gl_, support)); |
84 helper_scaling_.reset( | 84 helper_scaling_.reset( |
85 new display_compositor::GLHelperScaling(gl_, helper_.get())); | 85 new display_compositor::GLHelperScaling(gl_, helper_.get())); |
86 } | 86 } |
87 | 87 |
88 void TearDown() override { | 88 void TearDown() override { |
89 helper_scaling_.reset(NULL); | 89 helper_scaling_.reset(NULL); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 kQualityNames[q], percents[p]); | 245 kQualityNames[q], percents[p]); |
246 VLOG(0) << "Writing " << filename; | 246 VLOG(0) << "Writing " << filename; |
247 SaveToFile(&output_pixels, base::FilePath::FromUTF8Unsafe(filename)); | 247 SaveToFile(&output_pixels, base::FilePath::FromUTF8Unsafe(filename)); |
248 } | 248 } |
249 } | 249 } |
250 gl_->DeleteTextures(1, &src_texture); | 250 gl_->DeleteTextures(1, &src_texture); |
251 gl_->DeleteFramebuffers(1, &framebuffer); | 251 gl_->DeleteFramebuffers(1, &framebuffer); |
252 } | 252 } |
253 | 253 |
254 } // namespace display_compositor | 254 } // namespace display_compositor |
OLD | NEW |