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

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

Issue 1234313002: Make readpixels work on GrTextures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix and more kRT removal Created 5 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
« no previous file with comments | « no previous file | src/gpu/GrContext.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 2010 Google Inc. 2 * Copyright 2010 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 GrContext_DEFINED 8 #ifndef GrContext_DEFINED
9 #define GrContext_DEFINED 9 #define GrContext_DEFINED
10 10
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 kDontFlush_PixelOpsFlag = 0x1, 221 kDontFlush_PixelOpsFlag = 0x1,
222 /** Any surface writes should be flushed to the backend 3D API after the surface operation 222 /** Any surface writes should be flushed to the backend 3D API after the surface operation
223 is complete */ 223 is complete */
224 kFlushWrites_PixelOp = 0x2, 224 kFlushWrites_PixelOp = 0x2,
225 /** The src for write or dst read is unpremultiplied. This is only respe cted if both the 225 /** The src for write or dst read is unpremultiplied. This is only respe cted if both the
226 config src and dst configs are an RGBA/BGRA 8888 format. */ 226 config src and dst configs are an RGBA/BGRA 8888 format. */
227 kUnpremul_PixelOpsFlag = 0x4, 227 kUnpremul_PixelOpsFlag = 0x4,
228 }; 228 };
229 229
230 /** 230 /**
231 * Reads a rectangle of pixels from a render target. 231 * Reads a rectangle of pixels from a surface.
232 * @param target the render target to read from. 232 * @param surface the surface to read from.
233 * @param left left edge of the rectangle to read (inclusive) 233 * @param left left edge of the rectangle to read (inclusive)
234 * @param top top edge of the rectangle to read (inclusive) 234 * @param top top edge of the rectangle to read (inclusive)
235 * @param width width of rectangle to read in pixels. 235 * @param width width of rectangle to read in pixels.
236 * @param height height of rectangle to read in pixels. 236 * @param height height of rectangle to read in pixels.
237 * @param config the pixel config of the destination buffer 237 * @param config the pixel config of the destination buffer
238 * @param buffer memory to read the rectangle into. 238 * @param buffer memory to read the rectangle into.
239 * @param rowBytes number of bytes bewtween consecutive rows. Zero mean s rows are tightly 239 * @param rowBytes number of bytes bewtween consecutive rows. Zero mean s rows are tightly
240 * packed. 240 * packed.
241 * @param pixelOpsFlags see PixelOpsFlags enum above. 241 * @param pixelOpsFlags see PixelOpsFlags enum above.
242 * 242 *
243 * @return true if the read succeeded, false if not. The read can fail becau se of an unsupported 243 * @return true if the read succeeded, false if not. The read can fail becau se of an unsupported
244 * pixel config or because no render target is currently set and NUL L was passed for 244 * pixel configs
245 * target.
246 */ 245 */
247 bool readRenderTargetPixels(GrRenderTarget* target, 246 bool readSurfacePixels(GrSurface* surface,
248 int left, int top, int width, int height, 247 int left, int top, int width, int height,
249 GrPixelConfig config, void* buffer, 248 GrPixelConfig config, void* buffer,
250 size_t rowBytes = 0, 249 size_t rowBytes = 0,
251 uint32_t pixelOpsFlags = 0); 250 uint32_t pixelOpsFlags = 0);
252 251
253 /** 252 /**
254 * Writes a rectangle of pixels to a surface. 253 * Writes a rectangle of pixels to a surface.
255 * @param surface the surface to write to. 254 * @param surface the surface to write to.
256 * @param left left edge of the rectangle to write (inclusive) 255 * @param left left edge of the rectangle to write (inclusive)
257 * @param top top edge of the rectangle to write (inclusive) 256 * @param top top edge of the rectangle to write (inclusive)
258 * @param width width of rectangle to write in pixels. 257 * @param width width of rectangle to write in pixels.
259 * @param height height of rectangle to write in pixels. 258 * @param height height of rectangle to write in pixels.
260 * @param config the pixel config of the source buffer 259 * @param config the pixel config of the source buffer
261 * @param buffer memory to read pixels from 260 * @param buffer memory to read pixels from
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 /** 455 /**
457 * A callback similar to the above for use by the TextBlobCache 456 * A callback similar to the above for use by the TextBlobCache
458 * TODO move textblob draw calls below context so we can use the call above. 457 * TODO move textblob draw calls below context so we can use the call above.
459 */ 458 */
460 static void TextBlobCacheOverBudgetCB(void* data); 459 static void TextBlobCacheOverBudgetCB(void* data);
461 460
462 typedef SkRefCnt INHERITED; 461 typedef SkRefCnt INHERITED;
463 }; 462 };
464 463
465 #endif 464 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698