| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 InProcessContextFactory::InProcessContextFactory( | 87 InProcessContextFactory::InProcessContextFactory( |
| 88 bool context_factory_for_test, | 88 bool context_factory_for_test, |
| 89 cc::SurfaceManager* surface_manager) | 89 cc::SurfaceManager* surface_manager) |
| 90 : next_surface_id_namespace_(1u), | 90 : next_surface_id_namespace_(1u), |
| 91 use_test_surface_(true), | 91 use_test_surface_(true), |
| 92 context_factory_for_test_(context_factory_for_test), | 92 context_factory_for_test_(context_factory_for_test), |
| 93 surface_manager_(surface_manager) { | 93 surface_manager_(surface_manager) { |
| 94 DCHECK_NE(gfx::GetGLImplementation(), gfx::kGLImplementationNone) | 94 DCHECK_NE(gfx::GetGLImplementation(), gfx::kGLImplementationNone) |
| 95 << "If running tests, ensure that main() is calling " | 95 << "If running tests, ensure that main() is calling " |
| 96 << "gfx::GLSurfaceTestSupport::InitializeOneOff()"; | 96 << "gfx::GLSurfaceTestSupport::InitializeOneOff()"; |
| 97 | |
| 98 Layer::InitializeUILayerSettings(); | |
| 99 } | 97 } |
| 100 | 98 |
| 101 InProcessContextFactory::~InProcessContextFactory() { | 99 InProcessContextFactory::~InProcessContextFactory() { |
| 102 DCHECK(per_compositor_data_.empty()); | 100 DCHECK(per_compositor_data_.empty()); |
| 103 } | 101 } |
| 104 | 102 |
| 105 void InProcessContextFactory::CreateOutputSurface( | 103 void InProcessContextFactory::CreateOutputSurface( |
| 106 base::WeakPtr<Compositor> compositor) { | 104 base::WeakPtr<Compositor> compositor) { |
| 107 gpu::gles2::ContextCreationAttribHelper attribs; | 105 gpu::gles2::ContextCreationAttribHelper attribs; |
| 108 attribs.alpha_size = 8; | 106 attribs.alpha_size = 8; |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 } | 238 } |
| 241 | 239 |
| 242 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor, | 240 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor, |
| 243 const gfx::Size& size) { | 241 const gfx::Size& size) { |
| 244 if (!per_compositor_data_.count(compositor)) | 242 if (!per_compositor_data_.count(compositor)) |
| 245 return; | 243 return; |
| 246 per_compositor_data_[compositor]->display()->Resize(size); | 244 per_compositor_data_[compositor]->display()->Resize(size); |
| 247 } | 245 } |
| 248 | 246 |
| 249 } // namespace ui | 247 } // namespace ui |
| OLD | NEW |