| OLD | NEW |
| 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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 * is always a single pixel thick, else the rect is | 429 * is always a single pixel thick, else the rect is |
| 430 * mitered/beveled stroked based on stroke width. | 430 * mitered/beveled stroked based on stroke width. |
| 431 * The rects coords are used to access the paint (through texture matrix) | 431 * The rects coords are used to access the paint (through texture matrix) |
| 432 */ | 432 */ |
| 433 void drawRect(const GrPaint& paint, | 433 void drawRect(const GrPaint& paint, |
| 434 const SkMatrix& viewMatrix, | 434 const SkMatrix& viewMatrix, |
| 435 const SkRect&, | 435 const SkRect&, |
| 436 const GrStrokeInfo* strokeInfo = NULL); | 436 const GrStrokeInfo* strokeInfo = NULL); |
| 437 | 437 |
| 438 /** | 438 /** |
| 439 * Maps a rect of local coordinates onto the a rect of destination | 439 * Maps a rectangle of shader coordinates to a rectangle and draws that rect
angle |
| 440 * coordinates. The localRect is stretched over the dstRect. The dstRect is | |
| 441 * transformed by the context's matrix. An additional optional matrix can be | |
| 442 * provided to transform the local rect. | |
| 443 * | 440 * |
| 444 * @param paint describes how to color pixels. | 441 * @param paint describes how to color pixels. |
| 445 * @param viewMatrix transformation matrix | 442 * @param viewMatrix transformation matrix which applies to rectToDraw |
| 446 * @param dstRect the destination rect to draw. | 443 * @param rectToDraw the rectangle to draw |
| 447 * @param localRect rect of local coordinates to be mapped onto dstRect | 444 * @param localRect the rectangle of shader coordinates applied to rectT
oDraw |
| 445 * @param localMatrix an optional matrix to transform the shader coordinat
es before applying |
| 446 * to rectToDraw |
| 448 */ | 447 */ |
| 449 void drawRectToRect(const GrPaint& paint, | 448 void drawNonAARectToRect(const GrPaint& paint, |
| 450 const SkMatrix& viewMatrix, | 449 const SkMatrix& viewMatrix, |
| 451 const SkRect& dstRect, | 450 const SkRect& rectToDraw, |
| 452 const SkRect& localRect); | 451 const SkRect& localRect, |
| 452 const SkMatrix* localMatrix = NULL); |
| 453 |
| 454 /** |
| 455 * Draws a non-AA rect with paint and a localMatrix |
| 456 */ |
| 457 void drawNonAARectWithLocalMatrix(const GrPaint& paint, |
| 458 const SkMatrix& viewMatrix, |
| 459 const SkRect& rect, |
| 460 const SkMatrix& localMatrix) { |
| 461 this->drawNonAARectToRect(paint, viewMatrix, rect, rect, &localMatrix); |
| 462 } |
| 453 | 463 |
| 454 /** | 464 /** |
| 455 * Draw a roundrect using a paint. | 465 * Draw a roundrect using a paint. |
| 456 * | 466 * |
| 457 * @param paint describes how to color pixels. | 467 * @param paint describes how to color pixels. |
| 458 * @param viewMatrix transformation matrix | 468 * @param viewMatrix transformation matrix |
| 459 * @param rrect the roundrect to draw | 469 * @param rrect the roundrect to draw |
| 460 * @param strokeInfo the stroke information (width, join, cap) and | 470 * @param strokeInfo the stroke information (width, join, cap) and |
| 461 * the dash information (intervals, count, phase). | 471 * the dash information (intervals, count, phase). |
| 462 */ | 472 */ |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 880 /** | 890 /** |
| 881 * This callback allows the resource cache to callback into the GrContext | 891 * This callback allows the resource cache to callback into the GrContext |
| 882 * when the cache is still over budget after a purge. | 892 * when the cache is still over budget after a purge. |
| 883 */ | 893 */ |
| 884 static void OverBudgetCB(void* data); | 894 static void OverBudgetCB(void* data); |
| 885 | 895 |
| 886 typedef SkRefCnt INHERITED; | 896 typedef SkRefCnt INHERITED; |
| 887 }; | 897 }; |
| 888 | 898 |
| 889 #endif | 899 #endif |
| OLD | NEW |