| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "cc/test/pixel_test_output_surface.h" | 5 #include "cc/test/pixel_test_output_surface.h" |
| 6 | 6 |
| 7 #include "cc/output/output_surface_client.h" | 7 #include "cc/output/output_surface_client.h" |
| 8 #include "cc/scheduler/begin_frame_source.h" | 8 #include "cc/scheduler/begin_frame_source.h" |
| 9 #include "ui/gfx/transform.h" | 9 #include "ui/gfx/transform.h" |
| 10 | 10 |
| 11 namespace cc { | 11 namespace cc { |
| 12 | 12 |
| 13 PixelTestOutputSurface::PixelTestOutputSurface( | 13 PixelTestOutputSurface::PixelTestOutputSurface( |
| 14 scoped_refptr<ContextProvider> context_provider, | 14 std::unique_ptr<ContextProvider::Factory> compositor_context_factory, |
| 15 scoped_refptr<ContextProvider> worker_context_provider, | 15 scoped_refptr<ContextProvider> worker_context_provider, |
| 16 bool flipped_output_surface, | 16 bool flipped_output_surface, |
| 17 std::unique_ptr<BeginFrameSource> begin_frame_source) | 17 std::unique_ptr<BeginFrameSource> begin_frame_source) |
| 18 : OutputSurface(context_provider, worker_context_provider), | 18 : OutputSurface(std::move(compositor_context_factory), |
| 19 std::move(worker_context_provider)), |
| 19 begin_frame_source_(std::move(begin_frame_source)), | 20 begin_frame_source_(std::move(begin_frame_source)), |
| 20 external_stencil_test_(false) { | 21 external_stencil_test_(false) { |
| 21 capabilities_.adjust_deadline_for_parent = false; | 22 capabilities_.adjust_deadline_for_parent = false; |
| 22 capabilities_.flipped_output_surface = flipped_output_surface; | 23 capabilities_.flipped_output_surface = flipped_output_surface; |
| 23 } | 24 } |
| 24 | 25 |
| 25 PixelTestOutputSurface::PixelTestOutputSurface( | 26 PixelTestOutputSurface::PixelTestOutputSurface( |
| 26 scoped_refptr<ContextProvider> context_provider, | |
| 27 bool flipped_output_surface, | |
| 28 std::unique_ptr<BeginFrameSource> begin_frame_source) | |
| 29 : PixelTestOutputSurface(context_provider, | |
| 30 nullptr, | |
| 31 flipped_output_surface, | |
| 32 std::move(begin_frame_source)) {} | |
| 33 | |
| 34 PixelTestOutputSurface::PixelTestOutputSurface( | |
| 35 std::unique_ptr<SoftwareOutputDevice> software_device, | 27 std::unique_ptr<SoftwareOutputDevice> software_device, |
| 36 std::unique_ptr<BeginFrameSource> begin_frame_source) | 28 std::unique_ptr<BeginFrameSource> begin_frame_source) |
| 37 : OutputSurface(std::move(software_device)), | 29 : OutputSurface(std::move(software_device)), |
| 38 begin_frame_source_(std::move(begin_frame_source)), | 30 begin_frame_source_(std::move(begin_frame_source)), |
| 39 external_stencil_test_(false) {} | 31 external_stencil_test_(false) {} |
| 40 | 32 |
| 41 PixelTestOutputSurface::~PixelTestOutputSurface() {} | 33 PixelTestOutputSurface::~PixelTestOutputSurface() {} |
| 42 | 34 |
| 43 bool PixelTestOutputSurface::BindToClient(OutputSurfaceClient* client) { | 35 bool PixelTestOutputSurface::BindToClient(OutputSurfaceClient* client) { |
| 44 if (!OutputSurface::BindToClient(client)) | 36 if (!OutputSurface::BindToClient(client)) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 62 bool PixelTestOutputSurface::HasExternalStencilTest() const { | 54 bool PixelTestOutputSurface::HasExternalStencilTest() const { |
| 63 return external_stencil_test_; | 55 return external_stencil_test_; |
| 64 } | 56 } |
| 65 | 57 |
| 66 void PixelTestOutputSurface::SwapBuffers(CompositorFrame* frame) { | 58 void PixelTestOutputSurface::SwapBuffers(CompositorFrame* frame) { |
| 67 PostSwapBuffersComplete(); | 59 PostSwapBuffersComplete(); |
| 68 client_->DidSwapBuffers(); | 60 client_->DidSwapBuffers(); |
| 69 } | 61 } |
| 70 | 62 |
| 71 } // namespace cc | 63 } // namespace cc |
| OLD | NEW |