diff options
author | skyostil@chromium.org <skyostil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-04 12:18:30 +0000 |
---|---|---|
committer | skyostil@chromium.org <skyostil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-04 12:18:30 +0000 |
commit | d1a56f05be296acedfab104659f042395804c0b2 (patch) | |
tree | 0f6f04d4e736c79080ade2db6722045b014274ab /cc/test/render_pass_test_common.cc | |
parent | 364aaef8112e73e370b759e7a45bb0bd6164ada1 (diff) | |
download | chromium_src-d1a56f05be296acedfab104659f042395804c0b2.zip chromium_src-d1a56f05be296acedfab104659f042395804c0b2.tar.gz chromium_src-d1a56f05be296acedfab104659f042395804c0b2.tar.bz2 |
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
Diffstat (limited to 'cc/test/render_pass_test_common.cc')
-rw-r--r-- | cc/test/render_pass_test_common.cc | 35 |
1 files changed, 35 insertions, 0 deletions
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<DrawQuad>()); + scoped_ptr<cc::TileDrawQuad> 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<DrawQuad>()); + + scoped_ptr<cc::SharedQuadState> 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<cc::TileDrawQuad> 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<DrawQuad>()); + scoped_ptr<cc::TileDrawQuad> 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<DrawQuad>()); + AppendSharedQuadState(transformed_state.Pass()); AppendSharedQuadState(shared_state.Pass()); } |