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

Side by Side Diff: include/gpu/GrSurface.h

Issue 25021006: Add GrSurface::savePixels(). (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Remove unnecessary #include Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/gpu/GrSurface.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8
9 #ifndef GrSurface_DEFINED 9 #ifndef GrSurface_DEFINED
10 #define GrSurface_DEFINED 10 #define GrSurface_DEFINED
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 * @param rowBytes number of bytes between consecutive rows. Zero means rows are tightly 119 * @param rowBytes number of bytes between consecutive rows. Zero means rows are tightly
120 * packed. 120 * packed.
121 * @param pixelOpsFlags See the GrContext::PixelOpsFlags enum. 121 * @param pixelOpsFlags See the GrContext::PixelOpsFlags enum.
122 */ 122 */
123 virtual void writePixels(int left, int top, int width, int height, 123 virtual void writePixels(int left, int top, int width, int height,
124 GrPixelConfig config, 124 GrPixelConfig config,
125 const void* buffer, 125 const void* buffer,
126 size_t rowBytes = 0, 126 size_t rowBytes = 0,
127 uint32_t pixelOpsFlags = 0) = 0; 127 uint32_t pixelOpsFlags = 0) = 0;
128 128
129 /**
130 * Write the contents of the surface to a PNG. Returns true if successful.
131 * @param filename Full path to desired file
132 */
133 bool savePixels(const char* filename);
134
129 protected: 135 protected:
130 GrSurface(GrGpu* gpu, bool isWrapped, const GrTextureDesc& desc) 136 GrSurface(GrGpu* gpu, bool isWrapped, const GrTextureDesc& desc)
131 : INHERITED(gpu, isWrapped) 137 : INHERITED(gpu, isWrapped)
132 , fDesc(desc) { 138 , fDesc(desc) {
133 } 139 }
134 140
135 GrTextureDesc fDesc; 141 GrTextureDesc fDesc;
136 142
137 private: 143 private:
138 typedef GrResource INHERITED; 144 typedef GrResource INHERITED;
139 }; 145 };
140 146
141 #endif // GrSurface_DEFINED 147 #endif // GrSurface_DEFINED
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrSurface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698