Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Unified Diff: src/gpu/GrGpu.cpp

Issue 1310843007: Various minor cross-platform changes (Closed) Base URL: https://chromium.googlesource.com/skia@master
Patch Set: Update to ToT Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698