| 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 "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 void PixelTestOutputSurface::DiscardBackbuffer() {} | 38 void PixelTestOutputSurface::DiscardBackbuffer() {} |
| 39 | 39 |
| 40 void PixelTestOutputSurface::BindFramebuffer() { | 40 void PixelTestOutputSurface::BindFramebuffer() { |
| 41 context_provider()->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); | 41 context_provider()->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); |
| 42 } | 42 } |
| 43 | 43 |
| 44 void PixelTestOutputSurface::Reshape(const gfx::Size& size, | 44 void PixelTestOutputSurface::Reshape(const gfx::Size& size, |
| 45 float device_scale_factor, | 45 float device_scale_factor, |
| 46 const gfx::ColorSpace& color_space, | 46 const gfx::ColorSpace& color_space, |
| 47 bool has_alpha) { | 47 bool has_alpha, |
| 48 bool use_stencil) { |
| 48 if (context_provider()) { | 49 if (context_provider()) { |
| 49 context_provider()->ContextGL()->ResizeCHROMIUM( | 50 context_provider()->ContextGL()->ResizeCHROMIUM( |
| 50 size.width(), size.height(), device_scale_factor, has_alpha); | 51 size.width(), size.height(), device_scale_factor, has_alpha); |
| 51 } else { | 52 } else { |
| 52 software_device()->Resize(size, device_scale_factor); | 53 software_device()->Resize(size, device_scale_factor); |
| 53 } | 54 } |
| 54 } | 55 } |
| 55 | 56 |
| 56 bool PixelTestOutputSurface::HasExternalStencilTest() const { | 57 bool PixelTestOutputSurface::HasExternalStencilTest() const { |
| 57 return external_stencil_test_; | 58 return external_stencil_test_; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 87 } | 88 } |
| 88 | 89 |
| 89 uint32_t PixelTestOutputSurface::GetFramebufferCopyTextureFormat() { | 90 uint32_t PixelTestOutputSurface::GetFramebufferCopyTextureFormat() { |
| 90 // This format will work if the |context_provider| has an RGB or RGBA | 91 // This format will work if the |context_provider| has an RGB or RGBA |
| 91 // framebuffer. For now assume tests do not want/care about alpha in | 92 // framebuffer. For now assume tests do not want/care about alpha in |
| 92 // the root render pass. | 93 // the root render pass. |
| 93 return GL_RGB; | 94 return GL_RGB; |
| 94 } | 95 } |
| 95 | 96 |
| 96 } // namespace cc | 97 } // namespace cc |
| OLD | NEW |