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> | 7 #include <utility> |
8 | 8 |
9 #include "cc/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
10 #include "cc/output/output_surface_client.h" | 10 #include "cc/output/output_surface_client.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 PixelTestOutputSurface::PixelTestOutputSurface( | 35 PixelTestOutputSurface::PixelTestOutputSurface( |
36 std::unique_ptr<SoftwareOutputDevice> software_device) | 36 std::unique_ptr<SoftwareOutputDevice> software_device) |
37 : OutputSurface(nullptr, nullptr, std::move(software_device)), | 37 : OutputSurface(nullptr, nullptr, std::move(software_device)), |
38 external_stencil_test_(false) {} | 38 external_stencil_test_(false) {} |
39 | 39 |
40 PixelTestOutputSurface::~PixelTestOutputSurface() {} | 40 PixelTestOutputSurface::~PixelTestOutputSurface() {} |
41 | 41 |
42 void PixelTestOutputSurface::Reshape(const gfx::Size& size, | 42 void PixelTestOutputSurface::Reshape(const gfx::Size& size, |
43 float scale_factor, | 43 float scale_factor, |
| 44 const gfx::ColorSpace& color_space, |
44 bool has_alpha) { | 45 bool has_alpha) { |
45 gfx::Size expanded_size(size.width() + surface_expansion_size_.width(), | 46 gfx::Size expanded_size(size.width() + surface_expansion_size_.width(), |
46 size.height() + surface_expansion_size_.height()); | 47 size.height() + surface_expansion_size_.height()); |
47 OutputSurface::Reshape(expanded_size, scale_factor, has_alpha); | 48 OutputSurface::Reshape(expanded_size, scale_factor, color_space, has_alpha); |
48 } | 49 } |
49 | 50 |
50 bool PixelTestOutputSurface::HasExternalStencilTest() const { | 51 bool PixelTestOutputSurface::HasExternalStencilTest() const { |
51 return external_stencil_test_; | 52 return external_stencil_test_; |
52 } | 53 } |
53 | 54 |
54 void PixelTestOutputSurface::SwapBuffers(CompositorFrame frame) { | 55 void PixelTestOutputSurface::SwapBuffers(CompositorFrame frame) { |
55 PostSwapBuffersComplete(); | 56 PostSwapBuffersComplete(); |
56 client_->DidSwapBuffers(); | 57 client_->DidSwapBuffers(); |
57 } | 58 } |
58 | 59 |
59 uint32_t PixelTestOutputSurface::GetFramebufferCopyTextureFormat() { | 60 uint32_t PixelTestOutputSurface::GetFramebufferCopyTextureFormat() { |
60 // This format will work if the |context_provider| has an RGB or RGBA | 61 // This format will work if the |context_provider| has an RGB or RGBA |
61 // framebuffer. For now assume tests do not want/care about alpha in | 62 // framebuffer. For now assume tests do not want/care about alpha in |
62 // the root render pass. | 63 // the root render pass. |
63 return GL_RGB; | 64 return GL_RGB; |
64 } | 65 } |
65 | 66 |
66 } // namespace cc | 67 } // namespace cc |
OLD | NEW |