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

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

Issue 680413005: Don't allow renderTarget==NULL to GrContext::clear() and friends. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comment Created 6 years, 1 month 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/effects/SkAlphaThresholdFilter.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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 427
428 /////////////////////////////////////////////////////////////////////////// 428 ///////////////////////////////////////////////////////////////////////////
429 // Draws 429 // Draws
430 430
431 /** 431 /**
432 * Clear the entire or rect of the render target, ignoring any clips. 432 * Clear the entire or rect of the render target, ignoring any clips.
433 * @param rect the rect to clear or the whole thing if rect is NULL. 433 * @param rect the rect to clear or the whole thing if rect is NULL.
434 * @param color the color to clear to. 434 * @param color the color to clear to.
435 * @param canIgnoreRect allows partial clears to be converted to whole 435 * @param canIgnoreRect allows partial clears to be converted to whole
436 * clears on platforms for which that is cheap 436 * clears on platforms for which that is cheap
437 * @param target if non-NULL, the render target to clear otherwise clear 437 * @param target The render target to clear.
438 * the current render target
439 */ 438 */
440 void clear(const SkIRect* rect, GrColor color, bool canIgnoreRect, 439 void clear(const SkIRect* rect, GrColor color, bool canIgnoreRect, GrRenderT arget* target);
441 GrRenderTarget* target = NULL);
442 440
443 /** 441 /**
444 * Draw everywhere (respecting the clip) with the paint. 442 * Draw everywhere (respecting the clip) with the paint.
445 */ 443 */
446 void drawPaint(const GrPaint& paint); 444 void drawPaint(const GrPaint& paint);
447 445
448 /** 446 /**
449 * Draw the rect using a paint. 447 * Draw the rect using a paint.
450 * @param paint describes how to color pixels. 448 * @param paint describes how to color pixels.
451 * @param strokeInfo the stroke information (width, join, cap), and. 449 * @param strokeInfo the stroke information (width, join, cap), and.
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 /** Any surface writes should be flushed to the backend 3D API after the surface operation 577 /** Any surface writes should be flushed to the backend 3D API after the surface operation
580 is complete */ 578 is complete */
581 kFlushWrites_PixelOp = 0x2, 579 kFlushWrites_PixelOp = 0x2,
582 /** The src for write or dst read is unpremultiplied. This is only respe cted if both the 580 /** The src for write or dst read is unpremultiplied. This is only respe cted if both the
583 config src and dst configs are an RGBA/BGRA 8888 format. */ 581 config src and dst configs are an RGBA/BGRA 8888 format. */
584 kUnpremul_PixelOpsFlag = 0x4, 582 kUnpremul_PixelOpsFlag = 0x4,
585 }; 583 };
586 584
587 /** 585 /**
588 * Reads a rectangle of pixels from a render target. 586 * Reads a rectangle of pixels from a render target.
589 * @param target the render target to read from. NULL means the curre nt render target. 587 * @param target the render target to read from.
590 * @param left left edge of the rectangle to read (inclusive) 588 * @param left left edge of the rectangle to read (inclusive)
591 * @param top top edge of the rectangle to read (inclusive) 589 * @param top top edge of the rectangle to read (inclusive)
592 * @param width width of rectangle to read in pixels. 590 * @param width width of rectangle to read in pixels.
593 * @param height height of rectangle to read in pixels. 591 * @param height height of rectangle to read in pixels.
594 * @param config the pixel config of the destination buffer 592 * @param config the pixel config of the destination buffer
595 * @param buffer memory to read the rectangle into. 593 * @param buffer memory to read the rectangle into.
596 * @param rowBytes number of bytes bewtween consecutive rows. Zero mean s rows are tightly 594 * @param rowBytes number of bytes bewtween consecutive rows. Zero mean s rows are tightly
597 * packed. 595 * packed.
598 * @param pixelOpsFlags see PixelOpsFlags enum above. 596 * @param pixelOpsFlags see PixelOpsFlags enum above.
599 * 597 *
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 /** 1011 /**
1014 * This callback allows the resource cache to callback into the GrContext 1012 * This callback allows the resource cache to callback into the GrContext
1015 * when the cache is still overbudget after a purge. 1013 * when the cache is still overbudget after a purge.
1016 */ 1014 */
1017 static bool OverbudgetCB(void* data); 1015 static bool OverbudgetCB(void* data);
1018 1016
1019 typedef SkRefCnt INHERITED; 1017 typedef SkRefCnt INHERITED;
1020 }; 1018 };
1021 1019
1022 #endif 1020 #endif
OLDNEW
« no previous file with comments | « no previous file | src/effects/SkAlphaThresholdFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698