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

Unified Diff: cc/layer_tree_host_pixeltest_filters.cc

Issue 12518026: cc: Add layer-based pixel tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layer_tree_host_impl.h ('k') | cc/test/layer_tree_pixel_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host_pixeltest_filters.cc
diff --git a/cc/layer_tree_host_pixeltest_filters.cc b/cc/layer_tree_host_pixeltest_filters.cc
new file mode 100644
index 0000000000000000000000000000000000000000..37d2931dfa0e9cbf5173d45e597f261e6bb12d38
--- /dev/null
+++ b/cc/layer_tree_host_pixeltest_filters.cc
@@ -0,0 +1,39 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/test/layer_tree_pixel_test.h"
+
+#if !defined(OS_ANDROID)
+
+namespace cc {
+namespace {
+
+class LayerTreeHostFiltersPixelTest : public LayerTreePixelTest {};
+
+TEST_F(LayerTreeHostFiltersPixelTest, BackgroundFilterBlur) {
+ scoped_refptr<SolidColorLayer> background = CreateSolidColorLayer(
+ gfx::Rect(200, 200), SK_ColorWHITE);
+
+ // The green box is entirely behind a layer with background blur, so it
+ // should appear blurred on its edges.
+ scoped_refptr<SolidColorLayer> green = CreateSolidColorLayer(
+ gfx::Rect(50, 50, 100, 100), kCSSGreen);
+ scoped_refptr<SolidColorLayer> blur = CreateSolidColorLayer(
+ gfx::Rect(30, 30, 140, 140), SK_ColorTRANSPARENT);
+ background->AddChild(green);
+ background->AddChild(blur);
+
+ WebKit::WebFilterOperations filters;
+ filters.append(WebKit::WebFilterOperation::createBlurFilter(2));
+ blur->SetBackgroundFilters(filters);
+
+ RunPixelTest(background,
+ base::FilePath(FILE_PATH_LITERAL(
+ "background_filter_blur.png")));
+}
+
+} // namespace
+} // namespace cc
+
+#endif // OS_ANDROID
« no previous file with comments | « cc/layer_tree_host_impl.h ('k') | cc/test/layer_tree_pixel_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698