| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "cc/output/gl_renderer.h" | 10 #include "cc/output/gl_renderer.h" |
| (...skipping 2066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2077 &this->pass_list_, | 2077 &this->pass_list_, |
| 2078 base::FilePath(FILE_PATH_LITERAL("background_filter.png")), | 2078 base::FilePath(FILE_PATH_LITERAL("background_filter.png")), |
| 2079 ExactPixelComparator(true))); | 2079 ExactPixelComparator(true))); |
| 2080 } | 2080 } |
| 2081 | 2081 |
| 2082 class ExternalStencilPixelTest : public GLRendererPixelTest { | 2082 class ExternalStencilPixelTest : public GLRendererPixelTest { |
| 2083 protected: | 2083 protected: |
| 2084 void ClearBackgroundToGreen() { | 2084 void ClearBackgroundToGreen() { |
| 2085 GLES2Interface* gl = output_surface_->context_provider()->ContextGL(); | 2085 GLES2Interface* gl = output_surface_->context_provider()->ContextGL(); |
| 2086 output_surface_->EnsureBackbuffer(); | 2086 output_surface_->EnsureBackbuffer(); |
| 2087 output_surface_->Reshape(device_viewport_size_, 1, true); | 2087 output_surface_->Reshape(device_viewport_size_, 1, gfx::ColorProfile(), |
| 2088 true); |
| 2088 gl->ClearColor(0.f, 1.f, 0.f, 1.f); | 2089 gl->ClearColor(0.f, 1.f, 0.f, 1.f); |
| 2089 gl->Clear(GL_COLOR_BUFFER_BIT); | 2090 gl->Clear(GL_COLOR_BUFFER_BIT); |
| 2090 } | 2091 } |
| 2091 | 2092 |
| 2092 void PopulateStencilBuffer() { | 2093 void PopulateStencilBuffer() { |
| 2093 // Set two quadrants of the stencil buffer to 1. | 2094 // Set two quadrants of the stencil buffer to 1. |
| 2094 GLES2Interface* gl = output_surface_->context_provider()->ContextGL(); | 2095 GLES2Interface* gl = output_surface_->context_provider()->ContextGL(); |
| 2095 output_surface_->EnsureBackbuffer(); | 2096 output_surface_->EnsureBackbuffer(); |
| 2096 output_surface_->Reshape(device_viewport_size_, 1, true); | 2097 output_surface_->Reshape(device_viewport_size_, 1, gfx::ColorProfile(), |
| 2098 true); |
| 2097 gl->ClearStencil(0); | 2099 gl->ClearStencil(0); |
| 2098 gl->Clear(GL_STENCIL_BUFFER_BIT); | 2100 gl->Clear(GL_STENCIL_BUFFER_BIT); |
| 2099 gl->Enable(GL_SCISSOR_TEST); | 2101 gl->Enable(GL_SCISSOR_TEST); |
| 2100 gl->ClearStencil(1); | 2102 gl->ClearStencil(1); |
| 2101 gl->Scissor(0, | 2103 gl->Scissor(0, |
| 2102 0, | 2104 0, |
| 2103 device_viewport_size_.width() / 2, | 2105 device_viewport_size_.width() / 2, |
| 2104 device_viewport_size_.height() / 2); | 2106 device_viewport_size_.height() / 2); |
| 2105 gl->Clear(GL_STENCIL_BUFFER_BIT); | 2107 gl->Clear(GL_STENCIL_BUFFER_BIT); |
| 2106 gl->Scissor(device_viewport_size_.width() / 2, | 2108 gl->Scissor(device_viewport_size_.width() / 2, |
| (...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3174 | 3176 |
| 3175 EXPECT_TRUE(this->RunPixelTest( | 3177 EXPECT_TRUE(this->RunPixelTest( |
| 3176 &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")), | 3178 &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")), |
| 3177 FuzzyPixelOffByOneComparator(true))); | 3179 FuzzyPixelOffByOneComparator(true))); |
| 3178 } | 3180 } |
| 3179 | 3181 |
| 3180 #endif // !defined(OS_ANDROID) | 3182 #endif // !defined(OS_ANDROID) |
| 3181 | 3183 |
| 3182 } // namespace | 3184 } // namespace |
| 3183 } // namespace cc | 3185 } // namespace cc |
| OLD | NEW |