| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 // An OutputSurface implementation that directly draws and swaps to an actual | 44 // An OutputSurface implementation that directly draws and swaps to an actual |
| 45 // GL surface. | 45 // GL surface. |
| 46 class DirectOutputSurface : public cc::OutputSurface { | 46 class DirectOutputSurface : public cc::OutputSurface { |
| 47 public: | 47 public: |
| 48 DirectOutputSurface( | 48 DirectOutputSurface( |
| 49 const scoped_refptr<cc::ContextProvider>& context_provider, | 49 const scoped_refptr<cc::ContextProvider>& context_provider, |
| 50 const scoped_refptr<cc::ContextProvider>& worker_context_provider, | 50 const scoped_refptr<cc::ContextProvider>& worker_context_provider, |
| 51 std::unique_ptr<cc::BeginFrameSource> begin_frame_source) | 51 std::unique_ptr<cc::BeginFrameSource> begin_frame_source) |
| 52 : cc::OutputSurface(context_provider, worker_context_provider), | 52 : cc::OutputSurface(context_provider, worker_context_provider, nullptr), |
| 53 begin_frame_source_(std::move(begin_frame_source)), | 53 begin_frame_source_(std::move(begin_frame_source)), |
| 54 weak_ptr_factory_(this) {} | 54 weak_ptr_factory_(this) {} |
| 55 | 55 |
| 56 ~DirectOutputSurface() override {} | 56 ~DirectOutputSurface() override {} |
| 57 | 57 |
| 58 // cc::OutputSurface implementation | 58 // cc::OutputSurface implementation |
| 59 bool BindToClient(cc::OutputSurfaceClient* client) override { | 59 bool BindToClient(cc::OutputSurfaceClient* client) override { |
| 60 if (!OutputSurface::BindToClient(client)) | 60 if (!OutputSurface::BindToClient(client)) |
| 61 return false; | 61 return false; |
| 62 | 62 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 } | 257 } |
| 258 | 258 |
| 259 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor, | 259 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor, |
| 260 const gfx::Size& size) { | 260 const gfx::Size& size) { |
| 261 if (!per_compositor_data_.count(compositor)) | 261 if (!per_compositor_data_.count(compositor)) |
| 262 return; | 262 return; |
| 263 per_compositor_data_[compositor]->display()->Resize(size); | 263 per_compositor_data_[compositor]->display()->Resize(size); |
| 264 } | 264 } |
| 265 | 265 |
| 266 } // namespace ui | 266 } // namespace ui |
| OLD | NEW |