Various minor cross-platform changes

Review URL: https://codereview.chromium.org/1310843007
This commit is contained in:
jvanverth 2015-09-01 07:16:46 -07:00 committed by Commit bot
parent c5281e5b10
commit 2dc29940c5
2 changed files with 9 additions and 4 deletions

View File

@ -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();

View File

@ -564,10 +564,6 @@ bool GrGLGpu::onWritePixels(GrSurface* surface,
int left, int top, int width, int height,
GrPixelConfig config, const void* buffer,
size_t rowBytes) {
if (nullptr == buffer) {
return false;
}
GrGLTexture* glTex = static_cast<GrGLTexture*>(surface->asTexture());
if (!glTex) {
return false;