Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Side by Side Diff: cc/output/renderer_pixeltest.cc

Issue 2612023002: cc: Implement overdraw feedback debugging feature. (Closed)
Patch Set: fix typo in comment Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 2177 matching lines...) Expand 10 before | Expand all | Expand 10 after
2188 &this->pass_list_, 2188 &this->pass_list_,
2189 base::FilePath(FILE_PATH_LITERAL("background_filter.png")), 2189 base::FilePath(FILE_PATH_LITERAL("background_filter.png")),
2190 ExactPixelComparator(true))); 2190 ExactPixelComparator(true)));
2191 } 2191 }
2192 2192
2193 class ExternalStencilPixelTest : public GLRendererPixelTest { 2193 class ExternalStencilPixelTest : public GLRendererPixelTest {
2194 protected: 2194 protected:
2195 void ClearBackgroundToGreen() { 2195 void ClearBackgroundToGreen() {
2196 GLES2Interface* gl = output_surface_->context_provider()->ContextGL(); 2196 GLES2Interface* gl = output_surface_->context_provider()->ContextGL();
2197 output_surface_->EnsureBackbuffer(); 2197 output_surface_->EnsureBackbuffer();
2198 output_surface_->Reshape(device_viewport_size_, 1, gfx::ColorSpace(), true); 2198 output_surface_->Reshape(device_viewport_size_, 1, gfx::ColorSpace(), true,
2199 false);
2199 gl->ClearColor(0.f, 1.f, 0.f, 1.f); 2200 gl->ClearColor(0.f, 1.f, 0.f, 1.f);
2200 gl->Clear(GL_COLOR_BUFFER_BIT); 2201 gl->Clear(GL_COLOR_BUFFER_BIT);
2201 } 2202 }
2202 2203
2203 void PopulateStencilBuffer() { 2204 void PopulateStencilBuffer() {
2204 // Set two quadrants of the stencil buffer to 1. 2205 // Set two quadrants of the stencil buffer to 1.
2205 GLES2Interface* gl = output_surface_->context_provider()->ContextGL(); 2206 GLES2Interface* gl = output_surface_->context_provider()->ContextGL();
2206 output_surface_->EnsureBackbuffer(); 2207 output_surface_->EnsureBackbuffer();
2207 output_surface_->Reshape(device_viewport_size_, 1, gfx::ColorSpace(), true); 2208 output_surface_->Reshape(device_viewport_size_, 1, gfx::ColorSpace(), true,
2209 false);
2208 gl->ClearStencil(0); 2210 gl->ClearStencil(0);
2209 gl->Clear(GL_STENCIL_BUFFER_BIT); 2211 gl->Clear(GL_STENCIL_BUFFER_BIT);
2210 gl->Enable(GL_SCISSOR_TEST); 2212 gl->Enable(GL_SCISSOR_TEST);
2211 gl->ClearStencil(1); 2213 gl->ClearStencil(1);
2212 gl->Scissor(0, 2214 gl->Scissor(0,
2213 0, 2215 0,
2214 device_viewport_size_.width() / 2, 2216 device_viewport_size_.width() / 2,
2215 device_viewport_size_.height() / 2); 2217 device_viewport_size_.height() / 2);
2216 gl->Clear(GL_STENCIL_BUFFER_BIT); 2218 gl->Clear(GL_STENCIL_BUFFER_BIT);
2217 gl->Scissor(device_viewport_size_.width() / 2, 2219 gl->Scissor(device_viewport_size_.width() / 2,
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after
3264 3266
3265 EXPECT_TRUE(this->RunPixelTest( 3267 EXPECT_TRUE(this->RunPixelTest(
3266 &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")), 3268 &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")),
3267 FuzzyPixelOffByOneComparator(true))); 3269 FuzzyPixelOffByOneComparator(true)));
3268 } 3270 }
3269 3271
3270 #endif // !defined(OS_ANDROID) 3272 #endif // !defined(OS_ANDROID)
3271 3273
3272 } // namespace 3274 } // namespace
3273 } // namespace cc 3275 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698