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

Side by Side Diff: src/gpu/GrSurface.cpp

Issue 1018953003: Add SkEncodedFormat, used by SkCodec. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use a common enum for SkImageEncoder and SkImageDecoder and SkCodec Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrSurface.h" 8 #include "GrSurface.h"
9 #include "GrSurfacePriv.h" 9 #include "GrSurfacePriv.h"
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 bool result = this->readPixels(0, 0, this->width(), this->height(), kSkia888 8_GrPixelConfig, 62 bool result = this->readPixels(0, 0, this->width(), this->height(), kSkia888 8_GrPixelConfig,
63 bm.getPixels()); 63 bm.getPixels());
64 if (!result) { 64 if (!result) {
65 SkDebugf("------ failed to read pixels for %s\n", filename); 65 SkDebugf("------ failed to read pixels for %s\n", filename);
66 return false; 66 return false;
67 } 67 }
68 68
69 // remove any previous version of this file 69 // remove any previous version of this file
70 remove(filename); 70 remove(filename);
71 71
72 if (!SkImageEncoder::EncodeFile(filename, bm, SkImageEncoder::kPNG_Type, 100 )) { 72 if (!SkImageEncoder::EncodeFile(filename, bm, kPNG_SkEncodedFormat, 100)) {
73 SkDebugf("------ failed to encode %s\n", filename); 73 SkDebugf("------ failed to encode %s\n", filename);
74 remove(filename); // remove any partial file 74 remove(filename); // remove any partial file
75 return false; 75 return false;
76 } 76 }
77 77
78 return true; 78 return true;
79 } 79 }
80 80
81 void GrSurface::flushWrites() { 81 void GrSurface::flushWrites() {
82 if (!this->wasDestroyed()) { 82 if (!this->wasDestroyed()) {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 const GrTexture* thisTex = this->asTexture(); 118 const GrTexture* thisTex = this->asTexture();
119 if (thisTex && thisTex->internalHasPendingIO()) { 119 if (thisTex && thisTex->internalHasPendingIO()) {
120 return true; 120 return true;
121 } 121 }
122 const GrRenderTarget* thisRT = this->asRenderTarget(); 122 const GrRenderTarget* thisRT = this->asRenderTarget();
123 if (thisRT && thisRT->internalHasPendingIO()) { 123 if (thisRT && thisRT->internalHasPendingIO()) {
124 return true; 124 return true;
125 } 125 }
126 return false; 126 return false;
127 } 127 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698