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

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: Change to WebExternalTextureLayer::setNearestNeighbor. Created 6 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
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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 }; 196 };
197 197
198 TEST_F(TextureLayerTest, CheckPropertyChangeCausesCorrectBehavior) { 198 TEST_F(TextureLayerTest, CheckPropertyChangeCausesCorrectBehavior) {
199 scoped_refptr<TextureLayer> test_layer = 199 scoped_refptr<TextureLayer> test_layer =
200 TextureLayer::CreateForMailbox(nullptr); 200 TextureLayer::CreateForMailbox(nullptr);
201 EXPECT_SET_NEEDS_COMMIT(1, layer_tree_host_->SetRootLayer(test_layer)); 201 EXPECT_SET_NEEDS_COMMIT(1, layer_tree_host_->SetRootLayer(test_layer));
202 202
203 // Test properties that should call SetNeedsCommit. All properties need to 203 // Test properties that should call SetNeedsCommit. All properties need to
204 // be set to new values in order for SetNeedsCommit to be called. 204 // be set to new values in order for SetNeedsCommit to be called.
205 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetFlipped(false)); 205 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetFlipped(false));
206 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetNearestNeighbor(true));
206 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetUV( 207 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetUV(
207 gfx::PointF(0.25f, 0.25f), gfx::PointF(0.75f, 0.75f))); 208 gfx::PointF(0.25f, 0.25f), gfx::PointF(0.75f, 0.75f)));
208 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetVertexOpacity( 209 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetVertexOpacity(
209 0.5f, 0.5f, 0.5f, 0.5f)); 210 0.5f, 0.5f, 0.5f, 0.5f));
210 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetPremultipliedAlpha(false)); 211 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetPremultipliedAlpha(false));
211 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetBlendBackgroundColor(true)); 212 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetBlendBackgroundColor(true));
212 } 213 }
213 214
214 TEST_F(TextureLayerTest, VisibleContentOpaqueRegion) { 215 TEST_F(TextureLayerTest, VisibleContentOpaqueRegion) {
215 const gfx::Size layer_bounds(100, 100); 216 const gfx::Size layer_bounds(100, 100);
(...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after
1559 int callback_count_; 1560 int callback_count_;
1560 scoped_refptr<Layer> root_; 1561 scoped_refptr<Layer> root_;
1561 scoped_refptr<TextureLayer> layer_; 1562 scoped_refptr<TextureLayer> layer_;
1562 }; 1563 };
1563 1564
1564 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( 1565 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(
1565 TextureLayerWithMailboxImplThreadDeleted); 1566 TextureLayerWithMailboxImplThreadDeleted);
1566 1567
1567 } // namespace 1568 } // namespace
1568 } // namespace cc 1569 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698