Index: src/gpu/SkGpuDevice.cpp |
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp |
index cf1464a5989a27b621c40c7eed0d24cc60b890f1..4fa48e90447245f4f97312c6df0b14e0de49ec71 100644 |
--- a/src/gpu/SkGpuDevice.cpp |
+++ b/src/gpu/SkGpuDevice.cpp |
@@ -423,6 +423,21 @@ void SkGpuDevice::writePixels(const SkBitmap& bitmap, int x, int y, |
config, bitmap.getPixels(), bitmap.rowBytes(), flags); |
} |
+bool SkGpuDevice::onWritePixelsDirect(const SkImageInfo& info, const void* pixels, size_t rowBytes, |
+ int x, int y) { |
+ // TODO: teach fRenderTarget to take ImageInfo directly to specify the src pixels |
+ GrPixelConfig config = SkImageInfo2GrPixelConfig(info.colorType(), info.alphaType()); |
+ if (kUnknown_GrPixelConfig == config) { |
+ return false; |
+ } |
+ uint32_t flags = 0; |
+ if (kUnpremul_SkAlphaType == info.alphaType()) { |
+ flags = GrContext::kUnpremul_PixelOpsFlag; |
+ } |
+ fRenderTarget->writePixels(x, y, info.width(), info.height(), config, pixels, rowBytes, flags); |
+ return true; |
+} |
+ |
void SkGpuDevice::onAttachToCanvas(SkCanvas* canvas) { |
INHERITED::onAttachToCanvas(canvas); |