| 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 <utility> |
| 8 |
| 7 #include "cc/output/output_surface_client.h" | 9 #include "cc/output/output_surface_client.h" |
| 8 #include "cc/scheduler/begin_frame_source.h" | 10 #include "cc/scheduler/begin_frame_source.h" |
| 9 #include "ui/gfx/transform.h" | 11 #include "ui/gfx/transform.h" |
| 10 | 12 |
| 11 namespace cc { | 13 namespace cc { |
| 12 | 14 |
| 13 PixelTestOutputSurface::PixelTestOutputSurface( | 15 PixelTestOutputSurface::PixelTestOutputSurface( |
| 14 scoped_refptr<ContextProvider> context_provider, | 16 scoped_refptr<ContextProvider> context_provider, |
| 15 scoped_refptr<ContextProvider> worker_context_provider, | 17 scoped_refptr<ContextProvider> worker_context_provider, |
| 16 bool flipped_output_surface, | 18 bool flipped_output_surface, |
| 17 std::unique_ptr<BeginFrameSource> begin_frame_source) | 19 std::unique_ptr<BeginFrameSource> begin_frame_source) |
| 18 : OutputSurface(context_provider, worker_context_provider), | 20 : OutputSurface(std::move(context_provider), |
| 21 std::move(worker_context_provider), |
| 22 nullptr), |
| 19 begin_frame_source_(std::move(begin_frame_source)), | 23 begin_frame_source_(std::move(begin_frame_source)), |
| 20 external_stencil_test_(false) { | 24 external_stencil_test_(false) { |
| 21 capabilities_.adjust_deadline_for_parent = false; | 25 capabilities_.adjust_deadline_for_parent = false; |
| 22 capabilities_.flipped_output_surface = flipped_output_surface; | 26 capabilities_.flipped_output_surface = flipped_output_surface; |
| 23 } | 27 } |
| 24 | 28 |
| 25 PixelTestOutputSurface::PixelTestOutputSurface( | 29 PixelTestOutputSurface::PixelTestOutputSurface( |
| 26 scoped_refptr<ContextProvider> context_provider, | 30 scoped_refptr<ContextProvider> context_provider, |
| 27 bool flipped_output_surface, | 31 bool flipped_output_surface, |
| 28 std::unique_ptr<BeginFrameSource> begin_frame_source) | 32 std::unique_ptr<BeginFrameSource> begin_frame_source) |
| 29 : PixelTestOutputSurface(context_provider, | 33 : PixelTestOutputSurface(std::move(context_provider), |
| 30 nullptr, | 34 nullptr, |
| 31 flipped_output_surface, | 35 flipped_output_surface, |
| 32 std::move(begin_frame_source)) {} | 36 std::move(begin_frame_source)) {} |
| 33 | 37 |
| 34 PixelTestOutputSurface::PixelTestOutputSurface( | 38 PixelTestOutputSurface::PixelTestOutputSurface( |
| 35 std::unique_ptr<SoftwareOutputDevice> software_device, | 39 std::unique_ptr<SoftwareOutputDevice> software_device, |
| 36 std::unique_ptr<BeginFrameSource> begin_frame_source) | 40 std::unique_ptr<BeginFrameSource> begin_frame_source) |
| 37 : OutputSurface(std::move(software_device)), | 41 : OutputSurface(nullptr, nullptr, std::move(software_device)), |
| 38 begin_frame_source_(std::move(begin_frame_source)), | 42 begin_frame_source_(std::move(begin_frame_source)), |
| 39 external_stencil_test_(false) {} | 43 external_stencil_test_(false) {} |
| 40 | 44 |
| 41 PixelTestOutputSurface::~PixelTestOutputSurface() {} | 45 PixelTestOutputSurface::~PixelTestOutputSurface() {} |
| 42 | 46 |
| 43 bool PixelTestOutputSurface::BindToClient(OutputSurfaceClient* client) { | 47 bool PixelTestOutputSurface::BindToClient(OutputSurfaceClient* client) { |
| 44 if (!OutputSurface::BindToClient(client)) | 48 if (!OutputSurface::BindToClient(client)) |
| 45 return false; | 49 return false; |
| 46 | 50 |
| 47 // TODO(enne): Once the renderer uses begin frame sources, this will | 51 // TODO(enne): Once the renderer uses begin frame sources, this will |
| (...skipping 14 matching lines...) Expand all Loading... |
| 62 bool PixelTestOutputSurface::HasExternalStencilTest() const { | 66 bool PixelTestOutputSurface::HasExternalStencilTest() const { |
| 63 return external_stencil_test_; | 67 return external_stencil_test_; |
| 64 } | 68 } |
| 65 | 69 |
| 66 void PixelTestOutputSurface::SwapBuffers(CompositorFrame* frame) { | 70 void PixelTestOutputSurface::SwapBuffers(CompositorFrame* frame) { |
| 67 PostSwapBuffersComplete(); | 71 PostSwapBuffersComplete(); |
| 68 client_->DidSwapBuffers(); | 72 client_->DidSwapBuffers(); |
| 69 } | 73 } |
| 70 | 74 |
| 71 } // namespace cc | 75 } // namespace cc |
| OLD | NEW |