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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 weak_ptr_factory_(this) {} | 58 weak_ptr_factory_(this) {} |
59 | 59 |
60 ~DirectOutputSurface() override {} | 60 ~DirectOutputSurface() override {} |
61 | 61 |
62 // cc::OutputSurface implementation. | 62 // cc::OutputSurface implementation. |
63 bool BindToClient(cc::OutputSurfaceClient* client) override { | 63 bool BindToClient(cc::OutputSurfaceClient* client) override { |
64 if (!OutputSurface::BindToClient(client)) | 64 if (!OutputSurface::BindToClient(client)) |
65 return false; | 65 return false; |
66 return true; | 66 return true; |
67 } | 67 } |
68 void SwapBuffers(cc::CompositorFrame* frame) override { | 68 void SwapBuffers(std::unique_ptr<cc::CompositorFrame> frame) override { |
69 DCHECK(context_provider_.get()); | 69 DCHECK(context_provider_.get()); |
70 DCHECK(frame->gl_frame_data); | 70 DCHECK(frame->gl_frame_data); |
71 if (frame->gl_frame_data->sub_buffer_rect == | 71 if (frame->gl_frame_data->sub_buffer_rect == |
72 gfx::Rect(frame->gl_frame_data->size)) { | 72 gfx::Rect(frame->gl_frame_data->size)) { |
73 context_provider_->ContextSupport()->Swap(); | 73 context_provider_->ContextSupport()->Swap(); |
74 } else { | 74 } else { |
75 context_provider_->ContextSupport()->PartialSwapBuffers( | 75 context_provider_->ContextSupport()->PartialSwapBuffers( |
76 frame->gl_frame_data->sub_buffer_rect); | 76 frame->gl_frame_data->sub_buffer_rect); |
77 } | 77 } |
78 gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL(); | 78 gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL(); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 } | 259 } |
260 | 260 |
261 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor, | 261 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor, |
262 const gfx::Size& size) { | 262 const gfx::Size& size) { |
263 if (!per_compositor_data_.count(compositor)) | 263 if (!per_compositor_data_.count(compositor)) |
264 return; | 264 return; |
265 per_compositor_data_[compositor]->Resize(size); | 265 per_compositor_data_[compositor]->Resize(size); |
266 } | 266 } |
267 | 267 |
268 } // namespace ui | 268 } // namespace ui |
OLD | NEW |