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

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

Issue 1437413002: cc: Remove ScopedPtrVector and cc::remove_if. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/renderer.h ('k') | cc/output/texture_mailbox_deleter.h » ('j') | 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 "base/message_loop/message_loop.h" 5 #include "base/message_loop/message_loop.h"
6 #include "cc/output/gl_renderer.h" 6 #include "cc/output/gl_renderer.h"
7 #include "cc/quads/draw_quad.h" 7 #include "cc/quads/draw_quad.h"
8 #include "cc/quads/picture_draw_quad.h" 8 #include "cc/quads/picture_draw_quad.h"
9 #include "cc/quads/texture_draw_quad.h" 9 #include "cc/quads/texture_draw_quad.h"
10 #include "cc/resources/video_resource_updater.h" 10 #include "cc/resources/video_resource_updater.h"
(...skipping 2815 matching lines...) Expand 10 before | Expand all | Expand 10 after
2826 CreateTestSharedQuadState(gfx::Transform(), pass_rect, root_pass.get()); 2826 CreateTestSharedQuadState(gfx::Transform(), pass_rect, root_pass.get());
2827 CreateTestRenderPassDrawQuad( 2827 CreateTestRenderPassDrawQuad(
2828 pass_shared_state, pass_rect, child_pass_id, root_pass.get()); 2828 pass_shared_state, pass_rect, child_pass_id, root_pass.get());
2829 2829
2830 RenderPassList pass_list; 2830 RenderPassList pass_list;
2831 pass_list.push_back(child_pass.Pass()); 2831 pass_list.push_back(child_pass.Pass());
2832 pass_list.push_back(root_pass.Pass()); 2832 pass_list.push_back(root_pass.Pass());
2833 2833
2834 // Check that the child pass remains unflipped. 2834 // Check that the child pass remains unflipped.
2835 EXPECT_TRUE(this->RunPixelTestWithReadbackTarget( 2835 EXPECT_TRUE(this->RunPixelTestWithReadbackTarget(
2836 &pass_list, 2836 &pass_list, pass_list.front().get(),
2837 pass_list.front(),
2838 base::FilePath(FILE_PATH_LITERAL("blue_yellow.png")), 2837 base::FilePath(FILE_PATH_LITERAL("blue_yellow.png")),
2839 ExactPixelComparator(true))); 2838 ExactPixelComparator(true)));
2840 } 2839 }
2841 2840
2842 TEST_F(GLRendererPixelTest, CheckReadbackSubset) { 2841 TEST_F(GLRendererPixelTest, CheckReadbackSubset) {
2843 gfx::Rect viewport_rect(this->device_viewport_size_); 2842 gfx::Rect viewport_rect(this->device_viewport_size_);
2844 2843
2845 RenderPassId root_pass_id(1, 1); 2844 RenderPassId root_pass_id(1, 1);
2846 scoped_ptr<RenderPass> root_pass = 2845 scoped_ptr<RenderPass> root_pass =
2847 CreateTestRootRenderPass(root_pass_id, viewport_rect); 2846 CreateTestRootRenderPass(root_pass_id, viewport_rect);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
2880 RenderPassList pass_list; 2879 RenderPassList pass_list;
2881 pass_list.push_back(child_pass.Pass()); 2880 pass_list.push_back(child_pass.Pass());
2882 pass_list.push_back(root_pass.Pass()); 2881 pass_list.push_back(root_pass.Pass());
2883 2882
2884 // Check that the child pass remains unflipped. 2883 // Check that the child pass remains unflipped.
2885 gfx::Rect capture_rect(this->device_viewport_size_.width() / 2, 2884 gfx::Rect capture_rect(this->device_viewport_size_.width() / 2,
2886 this->device_viewport_size_.height() / 2, 2885 this->device_viewport_size_.height() / 2,
2887 this->device_viewport_size_.width() / 2, 2886 this->device_viewport_size_.width() / 2,
2888 this->device_viewport_size_.height() / 2); 2887 this->device_viewport_size_.height() / 2);
2889 EXPECT_TRUE(this->RunPixelTestWithReadbackTargetAndArea( 2888 EXPECT_TRUE(this->RunPixelTestWithReadbackTargetAndArea(
2890 &pass_list, 2889 &pass_list, pass_list.front().get(),
2891 pass_list.front(),
2892 base::FilePath(FILE_PATH_LITERAL("green_small_with_blue_corner.png")), 2890 base::FilePath(FILE_PATH_LITERAL("green_small_with_blue_corner.png")),
2893 ExactPixelComparator(true), 2891 ExactPixelComparator(true), &capture_rect));
2894 &capture_rect));
2895 } 2892 }
2896 2893
2897 TEST_F(GLRendererPixelTest, TextureQuadBatching) { 2894 TEST_F(GLRendererPixelTest, TextureQuadBatching) {
2898 // This test verifies that multiple texture quads using the same resource 2895 // This test verifies that multiple texture quads using the same resource
2899 // get drawn correctly. It implicitly is trying to test that the 2896 // get drawn correctly. It implicitly is trying to test that the
2900 // GLRenderer does the right thing with its draw quad cache. 2897 // GLRenderer does the right thing with its draw quad cache.
2901 2898
2902 gfx::Rect rect(this->device_viewport_size_); 2899 gfx::Rect rect(this->device_viewport_size_);
2903 2900
2904 RenderPassId id(1, 1); 2901 RenderPassId id(1, 1);
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
2972 2969
2973 EXPECT_TRUE(this->RunPixelTest( 2970 EXPECT_TRUE(this->RunPixelTest(
2974 &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")), 2971 &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")),
2975 FuzzyPixelOffByOneComparator(true))); 2972 FuzzyPixelOffByOneComparator(true)));
2976 } 2973 }
2977 2974
2978 #endif // !defined(OS_ANDROID) 2975 #endif // !defined(OS_ANDROID)
2979 2976
2980 } // namespace 2977 } // namespace
2981 } // namespace cc 2978 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/renderer.h ('k') | cc/output/texture_mailbox_deleter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698