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

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

Issue 558083002: [cc] Add nearest neighbor filtering for TextureLayer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and rebase Created 6 years 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/overlay_unittest.cc ('k') | cc/quads/draw_quad_unittest.cc » ('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/layers/append_quads_data.h" 6 #include "cc/layers/append_quads_data.h"
7 #include "cc/output/gl_renderer.h" 7 #include "cc/output/gl_renderer.h"
8 #include "cc/quads/draw_quad.h" 8 #include "cc/quads/draw_quad.h"
9 #include "cc/quads/picture_draw_quad.h" 9 #include "cc/quads/picture_draw_quad.h"
10 #include "cc/quads/texture_draw_quad.h" 10 #include "cc/quads/texture_draw_quad.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 quad->SetNew(shared_state, 145 quad->SetNew(shared_state,
146 rect, 146 rect,
147 gfx::Rect(), 147 gfx::Rect(),
148 rect, 148 rect,
149 resource, 149 resource,
150 premultiplied_alpha, 150 premultiplied_alpha,
151 gfx::PointF(0.0f, 0.0f), // uv_top_left 151 gfx::PointF(0.0f, 0.0f), // uv_top_left
152 gfx::PointF(1.0f, 1.0f), // uv_bottom_right 152 gfx::PointF(1.0f, 1.0f), // uv_bottom_right
153 background_color, 153 background_color,
154 vertex_opacity, 154 vertex_opacity,
155 false); // flipped 155 false, // flipped
156 false); // nearest_neighbor
156 } 157 }
157 158
158 typedef ::testing::Types<GLRenderer, 159 typedef ::testing::Types<GLRenderer,
159 SoftwareRenderer, 160 SoftwareRenderer,
160 GLRendererWithExpandedViewport, 161 GLRendererWithExpandedViewport,
161 SoftwareRendererWithExpandedViewport> RendererTypes; 162 SoftwareRendererWithExpandedViewport> RendererTypes;
162 TYPED_TEST_CASE(RendererPixelTest, RendererTypes); 163 TYPED_TEST_CASE(RendererPixelTest, RendererTypes);
163 164
164 template <typename RendererType> 165 template <typename RendererType>
165 class FuzzyForSoftwareOnlyPixelComparator : public PixelComparator { 166 class FuzzyForSoftwareOnlyPixelComparator : public PixelComparator {
(...skipping 2123 matching lines...) Expand 10 before | Expand all | Expand 10 after
2289 gfx::Rect(), 2290 gfx::Rect(),
2290 gfx::Rect(this->device_viewport_size_), 2291 gfx::Rect(this->device_viewport_size_),
2291 resource, 2292 resource,
2292 true, // premultiplied_alpha 2293 true, // premultiplied_alpha
2293 gfx::PointF(0.0f, 0.0f), // uv_top_left 2294 gfx::PointF(0.0f, 0.0f), // uv_top_left
2294 gfx::PointF( // uv_bottom_right 2295 gfx::PointF( // uv_bottom_right
2295 this->device_viewport_size_.width() / texture_rect.width(), 2296 this->device_viewport_size_.width() / texture_rect.width(),
2296 this->device_viewport_size_.height() / texture_rect.height()), 2297 this->device_viewport_size_.height() / texture_rect.height()),
2297 SK_ColorWHITE, 2298 SK_ColorWHITE,
2298 vertex_opacity, 2299 vertex_opacity,
2299 false); // flipped 2300 false, // flipped
2301 false); // nearest_neighbor
2300 2302
2301 RenderPassList pass_list; 2303 RenderPassList pass_list;
2302 pass_list.push_back(pass.Pass()); 2304 pass_list.push_back(pass.Pass());
2303 2305
2304 EXPECT_TRUE(this->RunPixelTest( 2306 EXPECT_TRUE(this->RunPixelTest(
2305 &pass_list, 2307 &pass_list,
2306 base::FilePath(FILE_PATH_LITERAL("wrap_mode_repeat.png")), 2308 base::FilePath(FILE_PATH_LITERAL("wrap_mode_repeat.png")),
2307 FuzzyPixelOffByOneComparator(true))); 2309 FuzzyPixelOffByOneComparator(true)));
2308 } 2310 }
2309 2311
2310 #endif // !defined(OS_ANDROID) 2312 #endif // !defined(OS_ANDROID)
2311 2313
2312 } // namespace 2314 } // namespace
2313 } // namespace cc 2315 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/overlay_unittest.cc ('k') | cc/quads/draw_quad_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698