Chromium Code Reviews| Index: src/gpu/GrGpu.cpp |
| diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp |
| index e2457ce31e4f47325e81ba1c3f744678e1399c24..092f848cf64066982beccc7845f8548d2b67605f 100644 |
| --- a/src/gpu/GrGpu.cpp |
| +++ b/src/gpu/GrGpu.cpp |
| @@ -334,7 +334,7 @@ bool GrGpu::writePixels(GrSurface* surface, |
| int left, int top, int width, int height, |
| GrPixelConfig config, const void* buffer, |
| size_t rowBytes) { |
| - if (!buffer) { |
| + if (!buffer || !surface) { |
| return false; |
| } |
| @@ -346,6 +346,23 @@ bool GrGpu::writePixels(GrSurface* surface, |
| return false; |
| } |
| +bool GrGpu::transferPixels(GrSurface* surface, |
| + int left, int top, int width, int height, |
| + GrPixelConfig config, GrTransferBuffer* buffer, |
| + size_t offset, size_t rowBytes) { |
| + if (!buffer) { |
|
bsalomon
2016/01/05 14:01:17
wondering whether this should be an assert since G
jvanverth1
2016/01/05 17:21:28
Done.
|
| + return false; |
| + } |
| + |
| + this->handleDirtyContext(); |
| + if (this->onTransferPixels(surface, left, top, width, height, config, |
| + buffer, offset, rowBytes)) { |
| + fStats.incTransfersToTexture(); |
| + return true; |
| + } |
| + return false; |
| +} |
| + |
| void GrGpu::resolveRenderTarget(GrRenderTarget* target) { |
| SkASSERT(target); |
| this->handleDirtyContext(); |