Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / platform / graphics / filters / FETile.cpp
index a60ca2e..9083e5f 100644 (file)
 
 #include "SkTileImageFilter.h"
 
-#include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/Pattern.h"
-#include "platform/graphics/UnacceleratedImageBufferSurface.h"
+#include "platform/graphics/filters/Filter.h"
 #include "platform/graphics/filters/SkiaImageFilterBuilder.h"
 #include "platform/text/TextStream.h"
-#include "platform/transforms/AffineTransform.h"
-#include "third_party/skia/include/core/SkDevice.h"
 
 namespace blink {
 
@@ -49,50 +45,6 @@ FloatRect FETile::mapPaintRect(const FloatRect& rect, bool forward)
     return forward ? maxEffectRect() : inputEffect(0)->maxEffectRect();
 }
 
-void FETile::applySoftware()
-{
-    FilterEffect* in = inputEffect(0);
-
-    ImageBuffer* resultImage = createImageBufferResult();
-    if (!resultImage)
-        return;
-
-    setIsAlphaImage(in->isAlphaImage());
-
-    // Source input needs more attention. It has the size of the filterRegion but gives the
-    // size of the cutted sourceImage back. This is part of the specification and optimization.
-    FloatRect tileRect = in->maxEffectRect();
-    FloatPoint inMaxEffectLocation = tileRect.location();
-    FloatPoint maxEffectLocation = maxEffectRect().location();
-    if (in->filterEffectType() == FilterEffectTypeSourceInput) {
-        Filter* filter = this->filter();
-        tileRect = filter->absoluteFilterRegion();
-    }
-
-    OwnPtr<ImageBufferSurface> surface;
-    IntSize intTileSize = roundedIntSize(tileRect.size());
-    surface = adoptPtr(new UnacceleratedImageBufferSurface(intTileSize));
-    OwnPtr<ImageBuffer> tileImage = ImageBuffer::create(surface.release());
-    if (!tileImage)
-        return;
-
-    GraphicsContext* tileImageContext = tileImage->context();
-    tileImageContext->scale(intTileSize.width() / tileRect.width(), intTileSize.height() / tileRect.height());
-    tileImageContext->translate(-inMaxEffectLocation.x(), -inMaxEffectLocation.y());
-
-    if (ImageBuffer* tileImageBuffer = in->asImageBuffer())
-        tileImageContext->drawImageBuffer(tileImageBuffer, IntRect(in->absolutePaintRect().location(), tileImageBuffer->size()));
-
-    RefPtr<Pattern> pattern = Pattern::createBitmapPattern(tileImage->copyImage(CopyBackingStore));
-
-    AffineTransform patternTransform;
-    patternTransform.translate(inMaxEffectLocation.x() - maxEffectLocation.x(), inMaxEffectLocation.y() - maxEffectLocation.y());
-    pattern->setPatternSpaceTransform(patternTransform);
-    GraphicsContext* filterContext = resultImage->context();
-    filterContext->setFillPattern(pattern);
-    filterContext->fillRect(FloatRect(FloatPoint(), absolutePaintRect().size()));
-}
-
 static FloatRect getRect(FilterEffect* effect)
 {
     FloatRect result = effect->filter()->filterRegion();