Index: src/core/SkLinearBitmapPipeline.cpp |
diff --git a/src/core/SkLinearBitmapPipeline.cpp b/src/core/SkLinearBitmapPipeline.cpp |
index 539547af9a903288f63a772e9a7be08b9666a614..77e034c9da4f1025a9e6c3193e095e442015967d 100644 |
--- a/src/core/SkLinearBitmapPipeline.cpp |
+++ b/src/core/SkLinearBitmapPipeline.cpp |
@@ -776,8 +776,33 @@ SkLinearBitmapPipeline::SkLinearBitmapPipeline( |
fLastStage = blenderStage; |
} |
+SkLinearBitmapPipeline::SkLinearBitmapPipeline( |
+ const SkLinearBitmapPipeline& pipeline, |
+ SkXfermode::Mode mode, |
+ const SkPixmap& srcPixmap, |
+ const SkImageInfo& dstInfo) |
+{ |
+ SkASSERT(mode == SkXfermode::kSrc_Mode); |
+ SkASSERT(srcPixmap.info().colorType() == dstInfo.colorType() |
+ && srcPixmap.info().colorType() == kRGBA_8888_SkColorType); |
+ |
+ fSampleStage.initSink<RGBA8888UnitRepeat>(srcPixmap.writable_addr32(0, 0), srcPixmap.width()); |
+ auto sampleStage = fSampleStage.get(); |
+ auto tilerStage = pipeline.fTileStage.cloneStageTo(sampleStage, &fTileStage); |
+ tilerStage = (tilerStage != nullptr) ? tilerStage : sampleStage; |
+ auto matrixStage = pipeline.fMatrixStage.cloneStageTo(tilerStage, &fMatrixStage); |
+ matrixStage = (matrixStage != nullptr) ? matrixStage : tilerStage; |
+ fFirstStage = matrixStage; |
+ fLastStage = fSampleStage.getInterface<DestinationInterface, RGBA8888UnitRepeat>(); |
+} |
mtklein
2016/04/11 16:43:25
It is weird that we've constructed an object here
herb_g
2016/04/12 20:03:49
I think that shadeSpan4f will go away as we restru
|
+ |
void SkLinearBitmapPipeline::shadeSpan4f(int x, int y, SkPM4f* dst, int count) { |
SkASSERT(count > 0); |
+ this->blitSpan(x, y, dst, count); |
+} |
+ |
+void SkLinearBitmapPipeline::blitSpan(int x, int y, void* dst, int count) { |
+ SkASSERT(count > 0); |
fLastStage->setDestination(dst, count); |
// The count and length arguments start out in a precise relation in order to keep the |