From cfa6f4e66a10dc138ab923dc402c99867ae27f4c Mon Sep 17 00:00:00 2001 From: "reveman@chromium.org" Date: Thu, 25 Apr 2013 23:25:25 +0000 Subject: Re-land: cc: Fix anti-aliasing of axis-aligned quads. Axis-aligned quads with edges not aligned to pixel boundaries are rendered incorrectly. These quads need anti-aliasing but current code that determines if anti-aliasing is needed thinks that no axis-aligned quads need it. This fixes the problem by adding alignment to pixel boundaries as an additional requirement to avoid anti-aliasing. BUG=169374 TEST=GLRendererPixelTest.AxisAligned,GLRendererShaderTest.DrawSolidColorShader Review URL: https://chromiumcodereview.appspot.com/12538005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196534 0039d316-1c4b-4281-b951-d872f2087c98 --- cc/test/render_pass_test_utils.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'cc/test/render_pass_test_utils.cc') diff --git a/cc/test/render_pass_test_utils.cc b/cc/test/render_pass_test_utils.cc index 24cb778..719be7f 100644 --- a/cc/test/render_pass_test_utils.cc +++ b/cc/test/render_pass_test_utils.cc @@ -57,6 +57,22 @@ SolidColorDrawQuad* AddClippedQuad(TestRenderPass* pass, return quad_ptr; } +SolidColorDrawQuad* AddTransformedQuad(TestRenderPass* pass, + gfx::Rect rect, + SkColor color, + const gfx::Transform& transform) { + MockQuadCuller quad_sink(&pass->quad_list, &pass->shared_quad_state_list); + AppendQuadsData data(pass->id); + SharedQuadState* shared_state = + quad_sink.UseSharedQuadState(SharedQuadState::Create()); + shared_state->SetAll(transform, rect.size(), rect, rect, false, 1); + scoped_ptr quad = SolidColorDrawQuad::Create(); + quad->SetNew(shared_state, rect, color); + SolidColorDrawQuad* quad_ptr = quad.get(); + quad_sink.Append(quad.PassAs(), &data); + return quad_ptr; +} + void AddRenderPassQuad(TestRenderPass* to_pass, TestRenderPass* contributing_pass) { MockQuadCuller quad_sink(&to_pass->quad_list, -- cgit v1.1