OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "cc/test/pixel_test_output_surface.h" |
| 6 |
| 7 #include "cc/output/output_surface_client.h" |
| 8 #include "ui/gfx/transform.h" |
| 9 |
| 10 namespace cc { |
| 11 |
| 12 PixelTestOutputSurface::PixelTestOutputSurface( |
| 13 scoped_refptr<ContextProvider> context_provider, |
| 14 scoped_refptr<ContextProvider> worker_context_provider, |
| 15 bool flipped_output_surface) |
| 16 : OutputSurface(context_provider, worker_context_provider), |
| 17 external_stencil_test_(false) { |
| 18 capabilities_.flipped_output_surface = flipped_output_surface; |
| 19 } |
| 20 |
| 21 PixelTestOutputSurface::PixelTestOutputSurface( |
| 22 scoped_refptr<ContextProvider> context_provider, |
| 23 bool flipped_output_surface) |
| 24 : PixelTestOutputSurface(context_provider, |
| 25 nullptr, |
| 26 flipped_output_surface) { |
| 27 } |
| 28 |
| 29 PixelTestOutputSurface::PixelTestOutputSurface( |
| 30 scoped_ptr<SoftwareOutputDevice> software_device) |
| 31 : OutputSurface(software_device.Pass()), external_stencil_test_(false) { |
| 32 } |
| 33 |
| 34 void PixelTestOutputSurface::Reshape(const gfx::Size& size, |
| 35 float scale_factor) { |
| 36 gfx::Size expanded_size(size.width() + surface_expansion_size_.width(), |
| 37 size.height() + surface_expansion_size_.height()); |
| 38 OutputSurface::Reshape(expanded_size, scale_factor); |
| 39 } |
| 40 |
| 41 bool PixelTestOutputSurface::HasExternalStencilTest() const { |
| 42 return external_stencil_test_; |
| 43 } |
| 44 |
| 45 void PixelTestOutputSurface::SwapBuffers(CompositorFrame* frame) { |
| 46 PostSwapBuffersComplete(); |
| 47 client_->DidSwapBuffers(); |
| 48 } |
| 49 |
| 50 } // namespace cc |
OLD | NEW |