Index: src/gpu/GrSurface.cpp |
diff --git a/src/gpu/GrSurface.cpp b/src/gpu/GrSurface.cpp |
index a7be0f47d96cdb890c159623843e6c861a9face5..d90bf24434cc88388970c06eb12597eee930d67d 100644 |
--- a/src/gpu/GrSurface.cpp |
+++ b/src/gpu/GrSurface.cpp |
@@ -92,17 +92,27 @@ bool GrSurfacePriv::AdjustWritePixelParams(int surfaceWidth, |
////////////////////////////////////////////////////////////////////////////// |
bool GrSurface::writePixels(int left, int top, int width, int height, |
- GrPixelConfig config, const void* buffer, size_t rowBytes, |
+ GrPixelConfig config, const SkTArray<SkMipMapLevel>& texels, |
uint32_t pixelOpsFlags) { |
// go through context so that all necessary flushing occurs |
GrContext* context = this->getContext(); |
if (nullptr == context) { |
return false; |
} |
- return context->writeSurfacePixels(this, left, top, width, height, config, buffer, rowBytes, |
+ return context->writeSurfacePixels(this, left, top, width, height, config, texels, |
pixelOpsFlags); |
} |
+bool GrSurface::writePixels(int left, int top, int width, int height, |
+ GrPixelConfig config, const void* buffer, size_t rowBytes, |
+ uint32_t pixelOpsFlags) { |
+ SkMipMapLevel level(buffer, rowBytes); |
+ const int levelCount = 1; |
+ SkTArray<SkMipMapLevel> texels(levelCount); |
+ texels.push_back(level); |
+ return this->writePixels(left, top, width, height, config, texels, pixelOpsFlags); |
+} |
+ |
bool GrSurface::readPixels(int left, int top, int width, int height, |
GrPixelConfig config, void* buffer, size_t rowBytes, |
uint32_t pixelOpsFlags) { |