OLD | NEW |
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 "ui/compositor/test/in_process_context_factory.h" | 5 #include "ui/compositor/test/in_process_context_factory.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 DCHECK_NE(gfx::GetGLImplementation(), gfx::kGLImplementationNone) | 74 DCHECK_NE(gfx::GetGLImplementation(), gfx::kGLImplementationNone) |
75 << "If running tests, ensure that main() is calling " | 75 << "If running tests, ensure that main() is calling " |
76 << "gfx::GLSurface::InitializeOneOffForTests()"; | 76 << "gfx::GLSurface::InitializeOneOffForTests()"; |
77 } | 77 } |
78 | 78 |
79 InProcessContextFactory::~InProcessContextFactory() { | 79 InProcessContextFactory::~InProcessContextFactory() { |
80 DCHECK(per_compositor_data_.empty()); | 80 DCHECK(per_compositor_data_.empty()); |
81 } | 81 } |
82 | 82 |
83 void InProcessContextFactory::CreateOutputSurface( | 83 void InProcessContextFactory::CreateOutputSurface( |
84 base::WeakPtr<Compositor> compositor, | 84 base::WeakPtr<Compositor> compositor) { |
85 bool software_fallback) { | |
86 DCHECK(!software_fallback); | |
87 gpu::gles2::ContextCreationAttribHelper attribs; | 85 gpu::gles2::ContextCreationAttribHelper attribs; |
88 attribs.alpha_size = 8; | 86 attribs.alpha_size = 8; |
89 attribs.blue_size = 8; | 87 attribs.blue_size = 8; |
90 attribs.green_size = 8; | 88 attribs.green_size = 8; |
91 attribs.red_size = 8; | 89 attribs.red_size = 8; |
92 attribs.depth_size = 0; | 90 attribs.depth_size = 0; |
93 attribs.stencil_size = 0; | 91 attribs.stencil_size = 0; |
94 attribs.samples = 0; | 92 attribs.samples = 0; |
95 attribs.sample_buffers = 0; | 93 attribs.sample_buffers = 0; |
96 attribs.fail_if_major_perf_caveat = false; | 94 attribs.fail_if_major_perf_caveat = false; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 } | 184 } |
187 | 185 |
188 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor, | 186 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor, |
189 const gfx::Size& size) { | 187 const gfx::Size& size) { |
190 if (!per_compositor_data_.count(compositor)) | 188 if (!per_compositor_data_.count(compositor)) |
191 return; | 189 return; |
192 per_compositor_data_[compositor]->display()->Resize(size); | 190 per_compositor_data_[compositor]->display()->Resize(size); |
193 } | 191 } |
194 | 192 |
195 } // namespace ui | 193 } // namespace ui |
OLD | NEW |