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

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

Issue 464273002: Cleanup namespace usage in platform/graphics/[filters/* to skia/*] and platform/graphics/[B-D]* (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 PassRefPtr<SkImageFilter> SkiaImageFilterBuilder::transformColorSpace( 79 PassRefPtr<SkImageFilter> SkiaImageFilterBuilder::transformColorSpace(
80 SkImageFilter* input, ColorSpace srcColorSpace, ColorSpace dstColorSpace) { 80 SkImageFilter* input, ColorSpace srcColorSpace, ColorSpace dstColorSpace) {
81 81
82 RefPtr<SkColorFilter> colorFilter = ImageBuffer::createColorSpaceFilter(srcC olorSpace, dstColorSpace); 82 RefPtr<SkColorFilter> colorFilter = ImageBuffer::createColorSpaceFilter(srcC olorSpace, dstColorSpace);
83 if (!colorFilter) 83 if (!colorFilter)
84 return input; 84 return input;
85 85
86 return adoptRef(SkColorFilterImageFilter::Create(colorFilter.get(), input)); 86 return adoptRef(SkColorFilterImageFilter::Create(colorFilter.get(), input));
87 } 87 }
88 88
89 void SkiaImageFilterBuilder::buildFilterOperations(const FilterOperations& opera tions, blink::WebFilterOperations* filters) 89 void SkiaImageFilterBuilder::buildFilterOperations(const FilterOperations& opera tions, WebFilterOperations* filters)
90 { 90 {
91 ColorSpace currentColorSpace = ColorSpaceDeviceRGB; 91 ColorSpace currentColorSpace = ColorSpaceDeviceRGB;
92 SkImageFilter* const nullFilter = 0; 92 SkImageFilter* const nullFilter = 0;
93 93
94 for (size_t i = 0; i < operations.size(); ++i) { 94 for (size_t i = 0; i < operations.size(); ++i) {
95 const FilterOperation& op = *operations.at(i); 95 const FilterOperation& op = *operations.at(i);
96 switch (op.type()) { 96 switch (op.type()) {
97 case FilterOperation::REFERENCE: { 97 case FilterOperation::REFERENCE: {
98 RefPtr<SkImageFilter> filter; 98 RefPtr<SkImageFilter> filter;
99 ReferenceFilter* referenceFilter = toReferenceFilterOperation(op).fi lter(); 99 ReferenceFilter* referenceFilter = toReferenceFilterOperation(op).fi lter();
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 } 165 }
166 break; 166 break;
167 } 167 }
168 case FilterOperation::BLUR: { 168 case FilterOperation::BLUR: {
169 float pixelRadius = toBlurFilterOperation(op).stdDeviation().getFloa tValue(); 169 float pixelRadius = toBlurFilterOperation(op).stdDeviation().getFloa tValue();
170 filters->appendBlurFilter(pixelRadius); 170 filters->appendBlurFilter(pixelRadius);
171 break; 171 break;
172 } 172 }
173 case FilterOperation::DROP_SHADOW: { 173 case FilterOperation::DROP_SHADOW: {
174 const DropShadowFilterOperation& drop = toDropShadowFilterOperation( op); 174 const DropShadowFilterOperation& drop = toDropShadowFilterOperation( op);
175 filters->appendDropShadowFilter(blink::WebPoint(drop.x(), drop.y()), drop.stdDeviation(), drop.color().rgb()); 175 filters->appendDropShadowFilter(WebPoint(drop.x(), drop.y()), drop.s tdDeviation(), drop.color().rgb());
176 break; 176 break;
177 } 177 }
178 case FilterOperation::NONE: 178 case FilterOperation::NONE:
179 break; 179 break;
180 } 180 }
181 } 181 }
182 if (currentColorSpace != ColorSpaceDeviceRGB) { 182 if (currentColorSpace != ColorSpaceDeviceRGB) {
183 // Transform to device color space at the end of processing, if required 183 // Transform to device color space at the end of processing, if required
184 RefPtr<SkImageFilter> filter = transformColorSpace(nullFilter, currentCo lorSpace, ColorSpaceDeviceRGB); 184 RefPtr<SkImageFilter> filter = transformColorSpace(nullFilter, currentCo lorSpace, ColorSpaceDeviceRGB);
185 filters->appendReferenceFilter(filter.get()); 185 filters->appendReferenceFilter(filter.get());
186 } 186 }
187 } 187 }
188 188
189 PassRefPtr<SkImageFilter> SkiaImageFilterBuilder::buildTransform(const AffineTra nsform& transform, SkImageFilter* input) 189 PassRefPtr<SkImageFilter> SkiaImageFilterBuilder::buildTransform(const AffineTra nsform& transform, SkImageFilter* input)
190 { 190 {
191 return adoptRef(SkMatrixImageFilter::Create(affineTransformToSkMatrix(transf orm), SkPaint::kHigh_FilterLevel, input)); 191 return adoptRef(SkMatrixImageFilter::Create(affineTransformToSkMatrix(transf orm), SkPaint::kHigh_FilterLevel, input));
192 } 192 }
193 193
194 }; 194 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/filters/SkiaImageFilterBuilder.h ('k') | Source/platform/graphics/gpu/DrawingBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698