Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple 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 16 matching lines...) Expand all Loading... | |
| 27 #include "platform/graphics/filters/FilterOperations.h" | 27 #include "platform/graphics/filters/FilterOperations.h" |
| 28 | 28 |
| 29 #include "platform/LengthFunctions.h" | 29 #include "platform/LengthFunctions.h" |
| 30 #include "platform/geometry/IntSize.h" | 30 #include "platform/geometry/IntSize.h" |
| 31 #include "platform/graphics/filters/FEGaussianBlur.h" | 31 #include "platform/graphics/filters/FEGaussianBlur.h" |
| 32 | 32 |
| 33 namespace WebCore { | 33 namespace WebCore { |
| 34 | 34 |
| 35 static inline IntSize outsetSizeForBlur(float stdDeviation) | 35 static inline IntSize outsetSizeForBlur(float stdDeviation) |
| 36 { | 36 { |
| 37 unsigned kernelSizeX = 0; | 37 IntSize kernelSize(0, 0); |
|
pdr.
2014/03/26 00:00:13
Is this needed?
| |
| 38 unsigned kernelSizeY = 0; | 38 kernelSize = FEGaussianBlur::calculateUnscaledKernelSize(FloatPoint(stdDevia tion, stdDeviation)); |
| 39 FEGaussianBlur::calculateUnscaledKernelSize(kernelSizeX, kernelSizeY, stdDev iation, stdDeviation); | |
| 40 | 39 |
| 41 IntSize outset; | 40 IntSize outset; |
| 42 // We take the half kernel size and multiply it with three, because we run b ox blur three times. | 41 // We take the half kernel size and multiply it with three, because we run b ox blur three times. |
| 43 outset.setWidth(3 * kernelSizeX * 0.5f); | 42 outset.setWidth(3 * kernelSize.width() * 0.5f); |
| 44 outset.setHeight(3 * kernelSizeY * 0.5f); | 43 outset.setHeight(3 * kernelSize.height() * 0.5f); |
| 45 | 44 |
| 46 return outset; | 45 return outset; |
| 47 } | 46 } |
| 48 | 47 |
| 49 FilterOperations::FilterOperations() | 48 FilterOperations::FilterOperations() |
| 50 { | 49 { |
| 51 } | 50 } |
| 52 | 51 |
| 53 FilterOperations& FilterOperations::operator=(const FilterOperations& other) | 52 FilterOperations& FilterOperations::operator=(const FilterOperations& other) |
| 54 { | 53 { |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 174 bool FilterOperations::hasFilterThatMovesPixels() const | 173 bool FilterOperations::hasFilterThatMovesPixels() const |
| 175 { | 174 { |
| 176 for (size_t i = 0; i < m_operations.size(); ++i) | 175 for (size_t i = 0; i < m_operations.size(); ++i) |
| 177 if (m_operations[i]->movesPixels()) | 176 if (m_operations[i]->movesPixels()) |
| 178 return true; | 177 return true; |
| 179 return false; | 178 return false; |
| 180 } | 179 } |
| 181 | 180 |
| 182 } // namespace WebCore | 181 } // namespace WebCore |
| 183 | 182 |
| OLD | NEW |