Various minor cross-platform changes

Review URL: https://codereview.chromium.org/1310843007
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 2fdfbc4..9f8e5e6 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -279,6 +279,11 @@
     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 @@
                         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();