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

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

Issue 1564703005: Implement external stencil for Android WebView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, fix pixel tests Created 4 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
« no previous file with comments | « cc/output/output_surface.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "cc/output/gl_renderer.h" 9 #include "cc/output/gl_renderer.h"
10 #include "cc/quads/draw_quad.h" 10 #include "cc/quads/draw_quad.h"
(...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after
1882 gl->Scissor(0, 1882 gl->Scissor(0,
1883 0, 1883 0,
1884 device_viewport_size_.width() / 2, 1884 device_viewport_size_.width() / 2,
1885 device_viewport_size_.height() / 2); 1885 device_viewport_size_.height() / 2);
1886 gl->Clear(GL_STENCIL_BUFFER_BIT); 1886 gl->Clear(GL_STENCIL_BUFFER_BIT);
1887 gl->Scissor(device_viewport_size_.width() / 2, 1887 gl->Scissor(device_viewport_size_.width() / 2,
1888 device_viewport_size_.height() / 2, 1888 device_viewport_size_.height() / 2,
1889 device_viewport_size_.width(), 1889 device_viewport_size_.width(),
1890 device_viewport_size_.height()); 1890 device_viewport_size_.height());
1891 gl->Clear(GL_STENCIL_BUFFER_BIT); 1891 gl->Clear(GL_STENCIL_BUFFER_BIT);
1892 gl->StencilFunc(GL_EQUAL, 1, 1);
1892 } 1893 }
1893 }; 1894 };
1894 1895
1895 TEST_F(ExternalStencilPixelTest, StencilTestEnabled) { 1896 TEST_F(ExternalStencilPixelTest, StencilTestEnabled) {
1896 ClearBackgroundToGreen(); 1897 ClearBackgroundToGreen();
1897 PopulateStencilBuffer(); 1898 PopulateStencilBuffer();
1898 this->EnableExternalStencilTest(); 1899 this->EnableExternalStencilTest();
1899 1900
1900 // Draw a blue quad that covers the entire device viewport. It should be 1901 // Draw a blue quad that covers the entire device viewport. It should be
1901 // clipped to the bottom left and top right corners by the external stencil. 1902 // clipped to the bottom left and top right corners by the external stencil.
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after
2974 2975
2975 EXPECT_TRUE(this->RunPixelTest( 2976 EXPECT_TRUE(this->RunPixelTest(
2976 &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")), 2977 &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")),
2977 FuzzyPixelOffByOneComparator(true))); 2978 FuzzyPixelOffByOneComparator(true)));
2978 } 2979 }
2979 2980
2980 #endif // !defined(OS_ANDROID) 2981 #endif // !defined(OS_ANDROID)
2981 2982
2982 } // namespace 2983 } // namespace
2983 } // namespace cc 2984 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/output_surface.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698