OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "cc/test/layer_tree_pixel_test.h" |
| 6 |
| 7 #if !defined(OS_ANDROID) |
| 8 |
| 9 namespace cc { |
| 10 namespace { |
| 11 |
| 12 class LayerTreeHostFiltersPixelTest : public LayerTreePixelTest {}; |
| 13 |
| 14 TEST_F(LayerTreeHostFiltersPixelTest, BackgroundFilterBlur) { |
| 15 scoped_refptr<SolidColorLayer> background = CreateSolidColorLayer( |
| 16 gfx::Rect(200, 200), SK_ColorWHITE); |
| 17 |
| 18 // The green box is entirely behind a layer with background blur, so it |
| 19 // should appear blurred on its edges. |
| 20 scoped_refptr<SolidColorLayer> green = CreateSolidColorLayer( |
| 21 gfx::Rect(50, 50, 100, 100), kCSSGreen); |
| 22 scoped_refptr<SolidColorLayer> blur = CreateSolidColorLayer( |
| 23 gfx::Rect(30, 30, 140, 140), SK_ColorTRANSPARENT); |
| 24 background->AddChild(green); |
| 25 background->AddChild(blur); |
| 26 |
| 27 WebKit::WebFilterOperations filters; |
| 28 filters.append(WebKit::WebFilterOperation::createBlurFilter(2)); |
| 29 blur->SetBackgroundFilters(filters); |
| 30 |
| 31 RunPixelTest(background, |
| 32 base::FilePath(FILE_PATH_LITERAL( |
| 33 "background_filter_blur.png"))); |
| 34 } |
| 35 |
| 36 } // namespace |
| 37 } // namespace cc |
| 38 |
| 39 #endif // OS_ANDROID |
OLD | NEW |