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

Side by Side Diff: cc/layers/texture_layer_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/layers/texture_layer_impl.cc ('k') | cc/layers/ui_resource_layer_impl.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 "cc/layers/texture_layer.h" 5 #include "cc/layers/texture_layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 }; 198 };
199 199
200 TEST_F(TextureLayerTest, CheckPropertyChangeCausesCorrectBehavior) { 200 TEST_F(TextureLayerTest, CheckPropertyChangeCausesCorrectBehavior) {
201 scoped_refptr<TextureLayer> test_layer = 201 scoped_refptr<TextureLayer> test_layer =
202 TextureLayer::CreateForMailbox(nullptr); 202 TextureLayer::CreateForMailbox(nullptr);
203 EXPECT_SET_NEEDS_COMMIT(1, layer_tree_host_->SetRootLayer(test_layer)); 203 EXPECT_SET_NEEDS_COMMIT(1, layer_tree_host_->SetRootLayer(test_layer));
204 204
205 // Test properties that should call SetNeedsCommit. All properties need to 205 // Test properties that should call SetNeedsCommit. All properties need to
206 // be set to new values in order for SetNeedsCommit to be called. 206 // be set to new values in order for SetNeedsCommit to be called.
207 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetFlipped(false)); 207 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetFlipped(false));
208 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetNearestNeighbor(true));
208 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetUV( 209 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetUV(
209 gfx::PointF(0.25f, 0.25f), gfx::PointF(0.75f, 0.75f))); 210 gfx::PointF(0.25f, 0.25f), gfx::PointF(0.75f, 0.75f)));
210 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetVertexOpacity( 211 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetVertexOpacity(
211 0.5f, 0.5f, 0.5f, 0.5f)); 212 0.5f, 0.5f, 0.5f, 0.5f));
212 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetPremultipliedAlpha(false)); 213 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetPremultipliedAlpha(false));
213 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetBlendBackgroundColor(true)); 214 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetBlendBackgroundColor(true));
214 } 215 }
215 216
216 TEST_F(TextureLayerTest, VisibleContentOpaqueRegion) { 217 TEST_F(TextureLayerTest, VisibleContentOpaqueRegion) {
217 const gfx::Size layer_bounds(100, 100); 218 const gfx::Size layer_bounds(100, 100);
(...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after
1561 int callback_count_; 1562 int callback_count_;
1562 scoped_refptr<Layer> root_; 1563 scoped_refptr<Layer> root_;
1563 scoped_refptr<TextureLayer> layer_; 1564 scoped_refptr<TextureLayer> layer_;
1564 }; 1565 };
1565 1566
1566 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( 1567 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(
1567 TextureLayerWithMailboxImplThreadDeleted); 1568 TextureLayerWithMailboxImplThreadDeleted);
1568 1569
1569 } // namespace 1570 } // namespace
1570 } // namespace cc 1571 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/texture_layer_impl.cc ('k') | cc/layers/ui_resource_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698