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

Unified Diff: Source/platform/graphics/filters/FEComponentTransfer.cpp

Issue 219183004: Remove software path from filters: FEComponentTransfer. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/graphics/filters/FEComponentTransfer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/filters/FEComponentTransfer.cpp
diff --git a/Source/platform/graphics/filters/FEComponentTransfer.cpp b/Source/platform/graphics/filters/FEComponentTransfer.cpp
index 40789f6c70f6232d1ffe01ec2d1ffe2047bf3c64..2ef679ccc9c46f08983df03663ef1addd8871c86 100644
--- a/Source/platform/graphics/filters/FEComponentTransfer.cpp
+++ b/Source/platform/graphics/filters/FEComponentTransfer.cpp
@@ -153,38 +153,14 @@ static void gamma(unsigned char* values, const ComponentTransferFunction& transf
void FEComponentTransfer::applySoftware()
{
FilterEffect* in = inputEffect(0);
-
- Uint8ClampedArray* pixelArray = createUnmultipliedImageResult();
- if (!pixelArray)
- return;
-
- unsigned char rValues[256], gValues[256], bValues[256], aValues[256];
- getValues(rValues, gValues, bValues, aValues);
- unsigned char* tables[] = { rValues, gValues, bValues, aValues };
-
- IntRect drawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
- in->copyUnmultipliedImage(pixelArray, drawingRect);
-
- unsigned pixelArrayLength = pixelArray->length();
- for (unsigned pixelOffset = 0; pixelOffset < pixelArrayLength; pixelOffset += 4) {
- for (unsigned channel = 0; channel < 4; ++channel) {
- unsigned char c = pixelArray->item(pixelOffset + channel);
- pixelArray->set(pixelOffset + channel, tables[channel][c]);
- }
- }
-}
-
-bool FEComponentTransfer::applySkia()
-{
- FilterEffect* in = inputEffect(0);
ImageBuffer* resultImage = createImageBufferResult();
if (!resultImage)
- return false;
+ return;
RefPtr<Image> image = in->asImageBuffer()->copyImage(DontCopyBackingStore);
RefPtr<NativeImageSkia> nativeImage = image->nativeImageForCurrentFrame();
if (!nativeImage)
- return false;
+ return;
unsigned char rValues[256], gValues[256], bValues[256], aValues[256];
getValues(rValues, gValues, bValues, aValues);
@@ -200,8 +176,6 @@ bool FEComponentTransfer::applySkia()
resultImage->context()->clipOut(destRect);
resultImage->context()->fillRect(fullRect, Color(rValues[0], gValues[0], bValues[0], aValues[0]));
}
-
- return true;
}
bool FEComponentTransfer::affectsTransparentPixels()
« no previous file with comments | « Source/platform/graphics/filters/FEComponentTransfer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698