- Revision
- 111760
- Author
- kar...@chromium.org
- Date
- 2012-03-22 14:09:20 -0700 (Thu, 22 Mar 2012)
Log Message
Revert 104566 - Source/WebCore: [Skia] Switch FEColorMatrix to use a skia-based implementation when
compiling with USE(SKIA). This change will also switch the software
implementation of FEGaussianBlur to the skia implementation (ie.,
it removes the acceleration check).
https://bugs.webkit.org/show_bug.cgi?id=75582
Reviewed by Dirk Schulze.
Covered by svg/W3C-SVG-1.1/filters-color-01-b.svg and friends (will
need a rebaseline).
* WebCore.gypi:
Add FEColorMatrixSkia.cpp to the build.
* platform/graphics/filters/FEColorMatrix.h:
Add platformApplySkia().
* platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::FEGaussianBlur::platformApplySoftware):
Remove skia-specific code from FEGaussianBlur::platformApplySoftware().
* platform/graphics/filters/FEGaussianBlur.h:
Make platformApplySkia() virtual, and put it behind #if USE(SKIA).
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::apply):
Call out to platformApplySkia(), or fall back to
platformApplySoftware().
* platform/graphics/filters/FilterEffect.h:
Add platformApplySkia().
* platform/graphics/filters/skia/FEColorMatrixSkia.cpp: Added.
(WebCore::saturateMatrix):
(WebCore::hueRotateMatrix):
(WebCore::luminanceToAlphaMatrix):
(WebCore::FEColorMatrix::platformApplySkia):
Process color matrix effect, by calling out to generic matrix
version of SkColorMatrixFilter.
* platform/graphics/filters/skia/FEGaussianBlurSkia.cpp:
(WebCore::FEGaussianBlur::platformApplySkia):
Change the signature of FEGaussianBlur::platformApplySkia to be an
override of the new FilterEffect base class version.
LayoutTests: [chomium] Mark svg FEColorMatrix tests as needing new baselines.
https://bugs.webkit.org/show_bug.cgi?id=75582
Reviewed by Dirk Schulze.
* platform/chromium/test_expectations.txt:
TBR=senorbla...@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9837019
Modified Paths
Diff
Modified: branches/chromium/1025/Source/WebCore/WebCore.gypi (111759 => 111760)
--- branches/chromium/1025/Source/WebCore/WebCore.gypi 2012-03-22 21:06:30 UTC (rev 111759)
+++ branches/chromium/1025/Source/WebCore/WebCore.gypi 2012-03-22 21:09:20 UTC (rev 111760)
@@ -3383,7 +3383,6 @@
'platform/graphics/filters/arm/FEGaussianBlurNEON.h',
'platform/graphics/filters/arm/FELightingNEON.cpp',
'platform/graphics/filters/arm/FELightingNEON.h',
- 'platform/graphics/filters/skia/FEColorMatrixSkia.cpp',
'platform/graphics/filters/skia/FEGaussianBlurSkia.cpp',
'platform/graphics/freetype/FontCacheFreeType.cpp',
'platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp',
Modified: branches/chromium/1025/Source/WebCore/platform/graphics/filters/FEColorMatrix.h (111759 => 111760)
--- branches/chromium/1025/Source/WebCore/platform/graphics/filters/FEColorMatrix.h 2012-03-22 21:06:30 UTC (rev 111759)
+++ branches/chromium/1025/Source/WebCore/platform/graphics/filters/FEColorMatrix.h 2012-03-22 21:09:20 UTC (rev 111760)
@@ -49,9 +49,6 @@
bool setValues(const Vector<float>&);
virtual void platformApplySoftware();
-#if USE(SKIA)
- virtual bool platformApplySkia();
-#endif
virtual void dump();
virtual TextStream& externalRepresentation(TextStream&, int indention) const;
Modified: branches/chromium/1025/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp (111759 => 111760)
--- branches/chromium/1025/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp 2012-03-22 21:06:30 UTC (rev 111759)
+++ branches/chromium/1025/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp 2012-03-22 21:09:20 UTC (rev 111760)
@@ -273,6 +273,13 @@
void FEGaussianBlur::platformApplySoftware()
{
+#if USE(SKIA)
+ if (filter()->renderingMode() == Accelerated) {
+ platformApplySkia();
+ return;
+ }
+#endif
+
FilterEffect* in = inputEffect(0);
ByteArray* srcPixelArray = createPremultipliedImageResult();
Modified: branches/chromium/1025/Source/WebCore/platform/graphics/filters/FEGaussianBlur.h (111759 => 111760)
--- branches/chromium/1025/Source/WebCore/platform/graphics/filters/FEGaussianBlur.h 2012-03-22 21:06:30 UTC (rev 111759)
+++ branches/chromium/1025/Source/WebCore/platform/graphics/filters/FEGaussianBlur.h 2012-03-22 21:09:20 UTC (rev 111760)
@@ -74,9 +74,7 @@
inline void platformApplyGeneric(ByteArray* srcPixelArray, ByteArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize);
inline void platformApplyNeon(ByteArray* srcPixelArray, ByteArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize);
-#if USE(SKIA)
- virtual bool platformApplySkia();
-#endif
+ void platformApplySkia();
float m_stdX;
float m_stdY;
Modified: branches/chromium/1025/Source/WebCore/platform/graphics/filters/FilterEffect.cpp (111759 => 111760)
--- branches/chromium/1025/Source/WebCore/platform/graphics/filters/FilterEffect.cpp 2012-03-22 21:06:30 UTC (rev 111759)
+++ branches/chromium/1025/Source/WebCore/platform/graphics/filters/FilterEffect.cpp 2012-03-22 21:09:20 UTC (rev 111760)
@@ -104,10 +104,6 @@
determineAbsolutePaintRect();
// Add platform specific apply functions here and return earlier.
-#if USE(SKIA)
- if (platformApplySkia())
- return;
-#endif
platformApplySoftware();
}
Modified: branches/chromium/1025/Source/WebCore/platform/graphics/filters/FilterEffect.h (111759 => 111760)
--- branches/chromium/1025/Source/WebCore/platform/graphics/filters/FilterEffect.h 2012-03-22 21:06:30 UTC (rev 111759)
+++ branches/chromium/1025/Source/WebCore/platform/graphics/filters/FilterEffect.h 2012-03-22 21:09:20 UTC (rev 111760)
@@ -87,9 +87,6 @@
void apply();
virtual void platformApplySoftware() = 0;
-#if USE(SKIA)
- virtual bool platformApplySkia() { return false; }
-#endif
virtual void dump() = 0;
virtual void determineAbsolutePaintRect();
Modified: branches/chromium/1025/Source/WebCore/platform/graphics/filters/skia/FEGaussianBlurSkia.cpp (111759 => 111760)
--- branches/chromium/1025/Source/WebCore/platform/graphics/filters/skia/FEGaussianBlurSkia.cpp 2012-03-22 21:06:30 UTC (rev 111759)
+++ branches/chromium/1025/Source/WebCore/platform/graphics/filters/skia/FEGaussianBlurSkia.cpp 2012-03-22 21:09:20 UTC (rev 111760)
@@ -32,11 +32,11 @@
namespace WebCore {
-bool FEGaussianBlur::platformApplySkia()
+void FEGaussianBlur::platformApplySkia()
{
ImageBuffer* resultImage = createImageBufferResult();
if (!resultImage)
- return false;
+ return;
FilterEffect* in = inputEffect(0);
@@ -57,7 +57,7 @@
paint.setColor(0xFFFFFFFF);
dstContext->drawImage(image.get(), ColorSpaceDeviceRGB, drawingRegion.location(), CompositeCopy);
canvas->restore();
- return true;
+ return;
}
};