summaryrefslogtreecommitdiffstats
path: root/cc/output/renderer_pixeltest.cc
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-08 17:38:42 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-08 17:38:42 +0000
commit8655719663496953e3aba965445c7fb68c88c9f5 (patch)
tree1c8778ae842969d2edd4ce80a7d259a9786af9ec /cc/output/renderer_pixeltest.cc
parent0a6c8f20de93e9cca42a63b76dd5fa484c52393b (diff)
downloadchromium_src-8655719663496953e3aba965445c7fb68c88c9f5.zip
chromium_src-8655719663496953e3aba965445c7fb68c88c9f5.tar.gz
chromium_src-8655719663496953e3aba965445c7fb68c88c9f5.tar.bz2
cc: Enable AntiAliasing for sub-pixel translations in software renderer
While here, make the blue/yellow tests horizontal instead of vertical stripes, so that we can detect vertical flipping issues. Tests: RendererPixelTest.EnlargedRenderPassTextureWithAntiAliasing R=enne BUG=247782 Review URL: https://chromiumcodereview.appspot.com/16634015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205076 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/output/renderer_pixeltest.cc')
-rw-r--r--cc/output/renderer_pixeltest.cc82
1 files changed, 75 insertions, 7 deletions
diff --git a/cc/output/renderer_pixeltest.cc b/cc/output/renderer_pixeltest.cc
index cb91ca6..76de3ad 100644
--- a/cc/output/renderer_pixeltest.cc
+++ b/cc/output/renderer_pixeltest.cc
@@ -536,7 +536,7 @@ TYPED_TEST(RendererPixelTest, FastPassColorFilterAlphaTranslation) {
FuzzyForSoftwareOnlyPixelComparator<TypeParam>(false)));
}
-TYPED_TEST(RendererPixelTest, DISABLED_RenderPassChangesSize) {
+TYPED_TEST(RendererPixelTest, EnlargedRenderPassTexture) {
gfx::Rect viewport_rect(this->device_viewport_size_);
RenderPass::Id root_pass_id(1, 1);
@@ -557,16 +557,16 @@ TYPED_TEST(RendererPixelTest, DISABLED_RenderPassChangesSize) {
blue->SetNew(shared_state.get(),
gfx::Rect(0,
0,
- this->device_viewport_size_.width() / 2,
- this->device_viewport_size_.height()),
+ this->device_viewport_size_.width(),
+ this->device_viewport_size_.height() / 2),
SK_ColorBLUE,
false);
scoped_ptr<SolidColorDrawQuad> yellow = SolidColorDrawQuad::Create();
yellow->SetNew(shared_state.get(),
- gfx::Rect(this->device_viewport_size_.width() / 2,
- 0,
- this->device_viewport_size_.width() / 2,
- this->device_viewport_size_.height()),
+ gfx::Rect(0,
+ this->device_viewport_size_.height() / 2,
+ this->device_viewport_size_.width(),
+ this->device_viewport_size_.height() / 2),
SK_ColorYELLOW,
false);
@@ -592,6 +592,74 @@ TYPED_TEST(RendererPixelTest, DISABLED_RenderPassChangesSize) {
ExactPixelComparator(true)));
}
+TYPED_TEST(RendererPixelTest, EnlargedRenderPassTextureWithAntiAliasing) {
+ gfx::Rect viewport_rect(this->device_viewport_size_);
+
+ RenderPass::Id root_pass_id(1, 1);
+ scoped_ptr<RenderPass> root_pass =
+ CreateTestRootRenderPass(root_pass_id, viewport_rect);
+
+ RenderPass::Id child_pass_id(2, 2);
+ gfx::Rect pass_rect(this->device_viewport_size_);
+ gfx::Transform transform_to_root;
+ scoped_ptr<RenderPass> child_pass =
+ CreateTestRenderPass(child_pass_id, pass_rect, transform_to_root);
+
+ gfx::Transform content_to_target_transform;
+ scoped_ptr<SharedQuadState> shared_state =
+ CreateTestSharedQuadState(content_to_target_transform, viewport_rect);
+
+ scoped_ptr<SolidColorDrawQuad> blue = SolidColorDrawQuad::Create();
+ blue->SetNew(shared_state.get(),
+ gfx::Rect(0,
+ 0,
+ this->device_viewport_size_.width(),
+ this->device_viewport_size_.height() / 2),
+ SK_ColorBLUE,
+ false);
+ scoped_ptr<SolidColorDrawQuad> yellow = SolidColorDrawQuad::Create();
+ yellow->SetNew(shared_state.get(),
+ gfx::Rect(0,
+ this->device_viewport_size_.height() / 2,
+ this->device_viewport_size_.width(),
+ this->device_viewport_size_.height() / 2),
+ SK_ColorYELLOW,
+ false);
+
+ child_pass->quad_list.push_back(blue.PassAs<DrawQuad>());
+ child_pass->quad_list.push_back(yellow.PassAs<DrawQuad>());
+
+ gfx::Transform aa_transform;
+ aa_transform.Translate(0.5, 0.0);
+
+ scoped_ptr<SharedQuadState> pass_shared_state =
+ CreateTestSharedQuadState(aa_transform, pass_rect);
+ root_pass->quad_list.push_back(
+ CreateTestRenderPassDrawQuad(pass_shared_state.get(),
+ pass_rect,
+ child_pass_id));
+
+ scoped_ptr<SharedQuadState> root_shared_state =
+ CreateTestSharedQuadState(gfx::Transform(), viewport_rect);
+ scoped_ptr<SolidColorDrawQuad> background = SolidColorDrawQuad::Create();
+ background->SetNew(root_shared_state.get(),
+ gfx::Rect(this->device_viewport_size_),
+ SK_ColorWHITE,
+ false);
+ root_pass->quad_list.push_back(background.PassAs<DrawQuad>());
+
+ RenderPassList pass_list;
+ pass_list.push_back(child_pass.Pass());
+ pass_list.push_back(root_pass.Pass());
+
+ this->renderer_->SetEnlargePassTextureAmountForTesting(gfx::Vector2d(50, 75));
+
+ EXPECT_TRUE(this->RunPixelTest(
+ &pass_list,
+ base::FilePath(FILE_PATH_LITERAL("blue_yellow_anti_aliasing.png")),
+ FuzzyForSoftwareOnlyPixelComparator<TypeParam>(true)));
+}
+
template <typename RendererType>
class RendererPixelTestWithBackgroundFilter
: public RendererPixelTest<RendererType> {