| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #ifndef GrSurfacePriv_DEFINED | 8 #ifndef GrSurfacePriv_DEFINED |
| 9 #define GrSurfacePriv_DEFINED | 9 #define GrSurfacePriv_DEFINED |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 size_t bpp, | 25 size_t bpp, |
| 26 int* left, int* top, int* width, int* heig
ht, | 26 int* left, int* top, int* width, int* heig
ht, |
| 27 void** data, | 27 void** data, |
| 28 size_t* rowBytes); | 28 size_t* rowBytes); |
| 29 static bool AdjustWritePixelParams(int surfaceWidth, | 29 static bool AdjustWritePixelParams(int surfaceWidth, |
| 30 int surfaceHeight, | 30 int surfaceHeight, |
| 31 size_t bpp, | 31 size_t bpp, |
| 32 int* left, int* top, int* width, int* heig
ht, | 32 int* left, int* top, int* width, int* heig
ht, |
| 33 const void** data, | 33 const void** data, |
| 34 size_t* rowBytes); | 34 size_t* rowBytes); |
| 35 /** | |
| 36 * Derive a SkImageInfo from the surface's descriptor. The caller must provi
de the alpha type as | |
| 37 * GrSurface has no equivalent. | |
| 38 */ | |
| 39 SkImageInfo info(SkAlphaType alphaType) const { return fSurface->info(alphaT
ype); } | |
| 40 | 35 |
| 41 /** | 36 /** |
| 42 * Write the contents of the surface to a PNG. Returns true if successful. | 37 * Write the contents of the surface to a PNG. Returns true if successful. |
| 43 * @param filename Full path to desired file | 38 * @param filename Full path to desired file |
| 44 */ | 39 */ |
| 45 bool savePixels(const char* filename) { return fSurface->savePixels(filename
); } | 40 bool savePixels(const char* filename) { return fSurface->savePixels(filename
); } |
| 46 | 41 |
| 47 bool hasPendingRead() const { return fSurface->hasPendingRead(); } | 42 bool hasPendingRead() const { return fSurface->hasPendingRead(); } |
| 48 bool hasPendingWrite() const { return fSurface->hasPendingWrite(); } | 43 bool hasPendingWrite() const { return fSurface->hasPendingWrite(); } |
| 49 bool hasPendingIO() const { return fSurface->hasPendingIO(); } | 44 bool hasPendingIO() const { return fSurface->hasPendingIO(); } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 62 friend class GrSurface; // to construct/copy this type. | 57 friend class GrSurface; // to construct/copy this type. |
| 63 }; | 58 }; |
| 64 | 59 |
| 65 inline GrSurfacePriv GrSurface::surfacePriv() { return GrSurfacePriv(this); } | 60 inline GrSurfacePriv GrSurface::surfacePriv() { return GrSurfacePriv(this); } |
| 66 | 61 |
| 67 inline const GrSurfacePriv GrSurface::surfacePriv() const { | 62 inline const GrSurfacePriv GrSurface::surfacePriv() const { |
| 68 return GrSurfacePriv(const_cast<GrSurface*>(this)); | 63 return GrSurfacePriv(const_cast<GrSurface*>(this)); |
| 69 } | 64 } |
| 70 | 65 |
| 71 #endif | 66 #endif |
| OLD | NEW |