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

Side by Side Diff: Source/platform/graphics/filters/ImageFilterBuilderTest.cpp

Issue 1326183002: Merge ReferenceFilter into Filter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Touchups; Rebase. Created 5 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 10 matching lines...) Expand all
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */ 23 */
24 24
25 #include "config.h" 25 #include "config.h"
26 26
27 #include "SkImageFilter.h" 27 #include "SkImageFilter.h"
28 #include "platform/graphics/filters/FEBlend.h" 28 #include "platform/graphics/filters/FEBlend.h"
29 #include "platform/graphics/filters/FEGaussianBlur.h" 29 #include "platform/graphics/filters/FEGaussianBlur.h"
30 #include "platform/graphics/filters/FEMerge.h" 30 #include "platform/graphics/filters/FEMerge.h"
31 #include "platform/graphics/filters/Filter.h"
31 #include "platform/graphics/filters/FilterOperations.h" 32 #include "platform/graphics/filters/FilterOperations.h"
32 #include "platform/graphics/filters/ReferenceFilter.h"
33 #include "platform/graphics/filters/SkiaImageFilterBuilder.h" 33 #include "platform/graphics/filters/SkiaImageFilterBuilder.h"
34 #include "platform/graphics/filters/SourceGraphic.h" 34 #include "platform/graphics/filters/SourceGraphic.h"
35 #include <gtest/gtest.h> 35 #include <gtest/gtest.h>
36 36
37 using testing::Test; 37 using testing::Test;
38 38
39 namespace blink { 39 namespace blink {
40 40
41 class ImageFilterBuilderTest : public Test { 41 class ImageFilterBuilderTest : public Test {
42 protected: 42 protected:
43 void colorSpaceTest() 43 void colorSpaceTest()
44 { 44 {
45 // Build filter tree 45 // Build filter tree
46 RefPtrWillBeRawPtr<ReferenceFilter> referenceFilter = ReferenceFilter::c reate(1.0f); 46 RefPtrWillBeRawPtr<Filter> referenceFilter = Filter::create(1.0f);
47 47
48 // Add a dummy source graphic input 48 // Add a dummy source graphic input
49 RefPtrWillBeRawPtr<FilterEffect> sourceEffect = referenceFilter->sourceG raphic(); 49 RefPtrWillBeRawPtr<FilterEffect> sourceEffect = referenceFilter->sourceG raphic();
50 sourceEffect->setOperatingColorSpace(ColorSpaceDeviceRGB); 50 sourceEffect->setOperatingColorSpace(ColorSpaceDeviceRGB);
51 51
52 // Add a blur effect (with input : source) 52 // Add a blur effect (with input : source)
53 RefPtrWillBeRawPtr<FilterEffect> blurEffect = 53 RefPtrWillBeRawPtr<FilterEffect> blurEffect =
54 FEGaussianBlur::create(referenceFilter.get(), 3.0f, 3.0f); 54 FEGaussianBlur::create(referenceFilter.get(), 3.0f, 3.0f);
55 blurEffect->setOperatingColorSpace(ColorSpaceLinearRGB); 55 blurEffect->setOperatingColorSpace(ColorSpaceLinearRGB);
56 blurEffect->inputEffects().append(sourceEffect); 56 blurEffect->inputEffects().append(sourceEffect);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 EXPECT_EQ(child->countInputs(), 1); 115 EXPECT_EQ(child->countInputs(), 1);
116 } 116 }
117 }; 117 };
118 118
119 TEST_F(ImageFilterBuilderTest, testColorSpace) 119 TEST_F(ImageFilterBuilderTest, testColorSpace)
120 { 120 {
121 colorSpaceTest(); 121 colorSpaceTest();
122 } 122 }
123 123
124 } // namespace blink 124 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/filters/FilterOperation.h ('k') | Source/platform/graphics/filters/ReferenceFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698