From d1a56f05be296acedfab104659f042395804c0b2 Mon Sep 17 00:00:00 2001 From: "skyostil@chromium.org" Date: Tue, 4 Dec 2012 12:18:30 +0000 Subject: Use nearest neighbor filtering for non-translated quads Draw tiled layer quads that only have a translation transformation component using nearest neighbor filtering instead of bilinear filtering. This has two advantages: 1. On some GPUs this can reduce memory bandwidth usage due to increased texture cache hit rate. 2. Linear filtering is known to give slightly different results on different GPUs because of differences in the texture sampling hardware. Avoiding bilinear filtering in the common case (i.e., when CSS transformation aren't used) makes WebKit layout test pixel dumps better comparable across different devices. TEST=ResourceProviderTest.ScopedSampler, GLRendererTest2.activeTextureState, manual testing with composited websites. BUG= Review URL: https://chromiumcodereview.appspot.com/11358181 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170944 0039d316-1c4b-4281-b951-d872f2087c98 --- cc/test/render_pass_test_common.cc | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'cc/test/render_pass_test_common.cc') diff --git a/cc/test/render_pass_test_common.cc b/cc/test/render_pass_test_common.cc index 93f2f34..1672039 100644 --- a/cc/test/render_pass_test_common.cc +++ b/cc/test/render_pass_test_common.cc @@ -100,6 +100,40 @@ void TestRenderPass::AppendOneOfEveryQuadType(cc::ResourceProvider* resourceProv false); AppendQuad(texture_quad.PassAs()); + scoped_ptr scaled_tile_quad = + cc::TileDrawQuad::Create(); + scaled_tile_quad->SetNew(shared_state.get(), + rect, + opaque_rect, + texture_resource, + gfx::RectF(0, 0, 50, 50), + gfx::Size(50, 50), + false, + false, + false, + false, + false); + AppendQuad(scaled_tile_quad.PassAs()); + + scoped_ptr transformed_state = shared_state->Copy(); + gfx::Transform rotation; + rotation.Rotate(45); + transformed_state->content_to_target_transform = transformed_state->content_to_target_transform * rotation; + scoped_ptr transformed_tile_quad = + cc::TileDrawQuad::Create(); + transformed_tile_quad->SetNew(transformed_state.get(), + rect, + opaque_rect, + texture_resource, + gfx::RectF(0, 0, 100, 100), + gfx::Size(100, 100), + false, + false, + false, + false, + false); + AppendQuad(transformed_tile_quad.PassAs()); + scoped_ptr tile_quad = cc::TileDrawQuad::Create(); tile_quad->SetNew(shared_state.get(), @@ -133,6 +167,7 @@ void TestRenderPass::AppendOneOfEveryQuadType(cc::ResourceProvider* resourceProv planes[2]); AppendQuad(yuv_quad.PassAs()); + AppendSharedQuadState(transformed_state.Pass()); AppendSharedQuadState(shared_state.Pass()); } -- cgit v1.1