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/output_surface_client.h" | 9 #include "cc/output/output_surface_client.h" |
10 #include "cc/output/output_surface_frame.h" | 10 #include "cc/output/output_surface_frame.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 void PixelTestOutputSurface::EnsureBackbuffer() {} | 32 void PixelTestOutputSurface::EnsureBackbuffer() {} |
33 | 33 |
34 void PixelTestOutputSurface::DiscardBackbuffer() {} | 34 void PixelTestOutputSurface::DiscardBackbuffer() {} |
35 | 35 |
36 void PixelTestOutputSurface::BindFramebuffer() { | 36 void PixelTestOutputSurface::BindFramebuffer() { |
37 context_provider()->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); | 37 context_provider()->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); |
38 } | 38 } |
39 | 39 |
40 void PixelTestOutputSurface::Reshape(const gfx::Size& size, | 40 void PixelTestOutputSurface::Reshape(const gfx::Size& size, |
41 float scale_factor, | 41 float device_scale_factor, |
42 const gfx::ColorSpace& color_space, | 42 const gfx::ColorSpace& color_space, |
43 bool has_alpha) { | 43 bool has_alpha) { |
44 gfx::Size expanded_size(size.width() + surface_expansion_size_.width(), | 44 if (context_provider()) { |
45 size.height() + surface_expansion_size_.height()); | 45 context_provider()->ContextGL()->ResizeCHROMIUM( |
46 OutputSurface::Reshape(expanded_size, scale_factor, color_space, has_alpha); | 46 size.width(), size.height(), device_scale_factor, has_alpha); |
| 47 } else { |
| 48 software_device()->Resize(size, device_scale_factor); |
| 49 } |
47 } | 50 } |
48 | 51 |
49 bool PixelTestOutputSurface::HasExternalStencilTest() const { | 52 bool PixelTestOutputSurface::HasExternalStencilTest() const { |
50 return external_stencil_test_; | 53 return external_stencil_test_; |
51 } | 54 } |
52 | 55 |
53 void PixelTestOutputSurface::ApplyExternalStencil() {} | 56 void PixelTestOutputSurface::ApplyExternalStencil() {} |
54 | 57 |
55 void PixelTestOutputSurface::SwapBuffers(OutputSurfaceFrame frame) { | 58 void PixelTestOutputSurface::SwapBuffers(OutputSurfaceFrame frame) { |
56 PostSwapBuffersComplete(); | 59 PostSwapBuffersComplete(); |
(...skipping 17 matching lines...) Expand all Loading... |
74 } | 77 } |
75 | 78 |
76 uint32_t PixelTestOutputSurface::GetFramebufferCopyTextureFormat() { | 79 uint32_t PixelTestOutputSurface::GetFramebufferCopyTextureFormat() { |
77 // This format will work if the |context_provider| has an RGB or RGBA | 80 // This format will work if the |context_provider| has an RGB or RGBA |
78 // framebuffer. For now assume tests do not want/care about alpha in | 81 // framebuffer. For now assume tests do not want/care about alpha in |
79 // the root render pass. | 82 // the root render pass. |
80 return GL_RGB; | 83 return GL_RGB; |
81 } | 84 } |
82 | 85 |
83 } // namespace cc | 86 } // namespace cc |
OLD | NEW |