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

Side by Side Diff: src/gpu/GrSurfacePriv.h

Issue 2173513002: Cleanup of code that converts from GPU-backed resources to SkImageInfo (Closed) Base URL: https://skia.googlesource.com/skia.git@fix-sync
Patch Set: Created 4 years, 5 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 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
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
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
OLDNEW
« no previous file with comments | « src/gpu/GrSurface.cpp ('k') | src/gpu/SkGpuDevice.h » ('j') | src/image/SkImage_Gpu.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698