| Index: src/gpu/GrGpu.cpp
|
| diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
|
| index 2fdfbc424200131b4f8ba1ad26a84b7dbe5966ba..9f8e5e6e0ee84be3337868d8e3e0ec635022ec0b 100644
|
| --- a/src/gpu/GrGpu.cpp
|
| +++ b/src/gpu/GrGpu.cpp
|
| @@ -279,6 +279,11 @@ bool GrGpu::getWritePixelsInfo(GrSurface* dstSurface, int width, int height, siz
|
| SkASSERT(tempDrawInfo);
|
| SkASSERT(kGpuPrefersDraw_DrawPreference != *drawPreference);
|
|
|
| + if (GrPixelConfigIsCompressed(dstSurface->desc().fConfig) &&
|
| + dstSurface->desc().fConfig != srcConfig) {
|
| + return false;
|
| + }
|
| +
|
| if (this->caps()->useDrawInsteadOfPartialRenderTargetWrite() &&
|
| SkToBool(dstSurface->asRenderTarget()) &&
|
| (width < dstSurface->width() || height < dstSurface->height())) {
|
| @@ -332,6 +337,10 @@ bool GrGpu::writePixels(GrSurface* surface,
|
| int left, int top, int width, int height,
|
| GrPixelConfig config, const void* buffer,
|
| size_t rowBytes) {
|
| + if (!buffer) {
|
| + return false;
|
| + }
|
| +
|
| this->handleDirtyContext();
|
| if (this->onWritePixels(surface, left, top, width, height, config, buffer, rowBytes)) {
|
| fStats.incTextureUploads();
|
|
|