OLD | NEW |
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 void SkiaImageFilterBuilder::buildFilterOperations(const FilterOperations& opera
tions, WebFilterOperations* filters) | 74 void SkiaImageFilterBuilder::buildFilterOperations(const FilterOperations& opera
tions, WebFilterOperations* filters) |
75 { | 75 { |
76 ColorSpace currentColorSpace = ColorSpaceDeviceRGB; | 76 ColorSpace currentColorSpace = ColorSpaceDeviceRGB; |
77 SkImageFilter* const nullFilter = 0; | 77 SkImageFilter* const nullFilter = 0; |
78 | 78 |
79 for (size_t i = 0; i < operations.size(); ++i) { | 79 for (size_t i = 0; i < operations.size(); ++i) { |
80 const FilterOperation& op = *operations.at(i); | 80 const FilterOperation& op = *operations.at(i); |
81 switch (op.type()) { | 81 switch (op.type()) { |
82 case FilterOperation::REFERENCE: { | 82 case FilterOperation::REFERENCE: { |
83 RefPtr<SkImageFilter> filter; | 83 RefPtr<SkImageFilter> filter; |
84 ReferenceFilter* referenceFilter = toReferenceFilterOperation(op).fi
lter(); | 84 Filter* referenceFilter = toReferenceFilterOperation(op).filter(); |
85 if (referenceFilter && referenceFilter->lastEffect()) { | 85 if (referenceFilter && referenceFilter->lastEffect()) { |
86 FilterEffect* filterEffect = referenceFilter->lastEffect(); | 86 FilterEffect* filterEffect = referenceFilter->lastEffect(); |
87 // Prepopulate SourceGraphic with two image filters: one with a
null image | 87 // Prepopulate SourceGraphic with two image filters: one with a
null image |
88 // filter, and the other with a colorspace conversion filter. | 88 // filter, and the other with a colorspace conversion filter. |
89 // We don't know what color space the interior nodes will reques
t, so we have to | 89 // We don't know what color space the interior nodes will reques
t, so we have to |
90 // initialize SourceGraphic with both options. | 90 // initialize SourceGraphic with both options. |
91 // Since we know SourceGraphic is always PM-valid, we also use | 91 // Since we know SourceGraphic is always PM-valid, we also use |
92 // these for the PM-validated options. | 92 // these for the PM-validated options. |
93 RefPtr<SkImageFilter> deviceFilter = transformColorSpace(nullFil
ter, currentColorSpace, ColorSpaceDeviceRGB); | 93 RefPtr<SkImageFilter> deviceFilter = transformColorSpace(nullFil
ter, currentColorSpace, ColorSpaceDeviceRGB); |
94 RefPtr<SkImageFilter> linearFilter = transformColorSpace(nullFil
ter, currentColorSpace, ColorSpaceLinearRGB); | 94 RefPtr<SkImageFilter> linearFilter = transformColorSpace(nullFil
ter, currentColorSpace, ColorSpaceLinearRGB); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 filters->appendReferenceFilter(filter.get()); | 171 filters->appendReferenceFilter(filter.get()); |
172 } | 172 } |
173 } | 173 } |
174 | 174 |
175 PassRefPtr<SkImageFilter> SkiaImageFilterBuilder::buildTransform(const AffineTra
nsform& transform, SkImageFilter* input) | 175 PassRefPtr<SkImageFilter> SkiaImageFilterBuilder::buildTransform(const AffineTra
nsform& transform, SkImageFilter* input) |
176 { | 176 { |
177 return adoptRef(SkImageFilter::CreateMatrixFilter(affineTransformToSkMatrix(
transform), kHigh_SkFilterQuality, input)); | 177 return adoptRef(SkImageFilter::CreateMatrixFilter(affineTransformToSkMatrix(
transform), kHigh_SkFilterQuality, input)); |
178 } | 178 } |
179 | 179 |
180 } // namespace blink | 180 } // namespace blink |
OLD | NEW |