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

Side by Side Diff: cc/surfaces/surface_aggregator_unittest.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/resources/texture_mailbox.cc ('k') | cc/test/render_pass_test_common.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "cc/output/compositor_frame.h" 5 #include "cc/output/compositor_frame.h"
6 #include "cc/output/delegated_frame_data.h" 6 #include "cc/output/delegated_frame_data.h"
7 #include "cc/quads/render_pass.h" 7 #include "cc/quads/render_pass.h"
8 #include "cc/quads/render_pass_draw_quad.h" 8 #include "cc/quads/render_pass_draw_quad.h"
9 #include "cc/quads/solid_color_draw_quad.h" 9 #include "cc/quads/solid_color_draw_quad.h"
10 #include "cc/quads/surface_draw_quad.h" 10 #include "cc/quads/surface_draw_quad.h"
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 const gfx::Rect rect; 1268 const gfx::Rect rect;
1269 const gfx::Rect opaque_rect; 1269 const gfx::Rect opaque_rect;
1270 const gfx::Rect visible_rect; 1270 const gfx::Rect visible_rect;
1271 bool needs_blending = false; 1271 bool needs_blending = false;
1272 bool premultiplied_alpha = false; 1272 bool premultiplied_alpha = false;
1273 const gfx::PointF uv_top_left; 1273 const gfx::PointF uv_top_left;
1274 const gfx::PointF uv_bottom_right; 1274 const gfx::PointF uv_bottom_right;
1275 SkColor background_color = SK_ColorGREEN; 1275 SkColor background_color = SK_ColorGREEN;
1276 const float vertex_opacity[4] = {0.f, 0.f, 1.f, 1.f}; 1276 const float vertex_opacity[4] = {0.f, 0.f, 1.f, 1.f};
1277 bool flipped = false; 1277 bool flipped = false;
1278 bool nearest_neighbor = false;
1278 quad->SetAll(sqs, 1279 quad->SetAll(sqs,
1279 rect, 1280 rect,
1280 opaque_rect, 1281 opaque_rect,
1281 visible_rect, 1282 visible_rect,
1282 needs_blending, 1283 needs_blending,
1283 resource_ids[i], 1284 resource_ids[i],
1284 premultiplied_alpha, 1285 premultiplied_alpha,
1285 uv_top_left, 1286 uv_top_left,
1286 uv_bottom_right, 1287 uv_bottom_right,
1287 background_color, 1288 background_color,
1288 vertex_opacity, 1289 vertex_opacity,
1289 flipped); 1290 flipped,
1291 nearest_neighbor);
1290 1292
1291 quad->shared_quad_state = sqs; 1293 quad->shared_quad_state = sqs;
1292 } 1294 }
1293 frame_data->render_pass_list.push_back(pass.Pass()); 1295 frame_data->render_pass_list.push_back(pass.Pass());
1294 scoped_ptr<CompositorFrame> frame(new CompositorFrame); 1296 scoped_ptr<CompositorFrame> frame(new CompositorFrame);
1295 frame->delegated_frame_data = frame_data.Pass(); 1297 frame->delegated_frame_data = frame_data.Pass();
1296 factory->SubmitFrame(surface_id, frame.Pass(), base::Closure()); 1298 factory->SubmitFrame(surface_id, frame.Pass(), base::Closure());
1297 } 1299 }
1298 1300
1299 TEST_F(SurfaceAggregatorWithResourcesTest, TakeResourcesOneSurface) { 1301 TEST_F(SurfaceAggregatorWithResourcesTest, TakeResourcesOneSurface) {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1355 EXPECT_THAT(returned_ids, 1357 EXPECT_THAT(returned_ids,
1356 testing::WhenSorted(testing::ElementsAreArray(ids))); 1358 testing::WhenSorted(testing::ElementsAreArray(ids)));
1357 EXPECT_EQ(3u, resource_provider_->num_resources()); 1359 EXPECT_EQ(3u, resource_provider_->num_resources());
1358 factory.Destroy(surface_id); 1360 factory.Destroy(surface_id);
1359 factory.Destroy(surface_id2); 1361 factory.Destroy(surface_id2);
1360 } 1362 }
1361 1363
1362 } // namespace 1364 } // namespace
1363 } // namespace cc 1365 } // namespace cc
1364 1366
OLDNEW
« no previous file with comments | « cc/resources/texture_mailbox.cc ('k') | cc/test/render_pass_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698