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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 | 461 |
462 /** | 462 /** |
463 * Draw the rect using a paint. | 463 * Draw the rect using a paint. |
464 * @param paint describes how to color pixels. | 464 * @param paint describes how to color pixels. |
465 * @param strokeInfo the stroke information (width, join, cap), and. | 465 * @param strokeInfo the stroke information (width, join, cap), and. |
466 * the dash information (intervals, count, phase). | 466 * the dash information (intervals, count, phase). |
467 * If strokeInfo == NULL, then the rect is filled. | 467 * If strokeInfo == NULL, then the rect is filled. |
468 * Otherwise, if stroke width == 0, then the stroke | 468 * Otherwise, if stroke width == 0, then the stroke |
469 * is always a single pixel thick, else the rect is | 469 * is always a single pixel thick, else the rect is |
470 * mitered/beveled stroked based on stroke width. | 470 * mitered/beveled stroked based on stroke width. |
471 * If the stroke is dashed the rect is sent to drawPath
. | |
472 * @param matrix Optional matrix applied to the rect. Applied before | |
473 * context's matrix or the paint's matrix. | |
474 * The rects coords are used to access the paint (through texture matrix) | 471 * The rects coords are used to access the paint (through texture matrix) |
475 */ | 472 */ |
476 void drawRect(const GrPaint& paint, | 473 void drawRect(const GrPaint& paint, |
477 const SkRect&, | 474 const SkRect&, |
478 const GrStrokeInfo* strokeInfo = NULL, | 475 const GrStrokeInfo* strokeInfo = NULL); |
479 const SkMatrix* matrix = NULL); | |
480 | 476 |
481 /** | 477 /** |
482 * Maps a rect of local coordinates onto the a rect of destination | 478 * Maps a rect of local coordinates onto the a rect of destination |
483 * coordinates. Each rect can optionally be transformed. The localRect | 479 * coordinates. The localRect is stretched over the dstRect. The dstRect is |
484 * is stretched over the dstRect. The dstRect is transformed by the | 480 * transformed by the context's matrix. An additional optional matrix can be |
485 * context's matrix. Additional optional matrices for both rects can be | 481 * provided to transform the local rect. |
486 * provided by parameters. | |
487 * | 482 * |
488 * @param paint describes how to color pixels. | 483 * @param paint describes how to color pixels. |
489 * @param dstRect the destination rect to draw. | 484 * @param dstRect the destination rect to draw. |
490 * @param localRect rect of local coordinates to be mapped onto dstRect | 485 * @param localRect rect of local coordinates to be mapped onto dstRect |
491 * @param dstMatrix Optional matrix to transform dstRect. Applied before
context's matrix. | |
492 * @param localMatrix Optional matrix to transform localRect. | 486 * @param localMatrix Optional matrix to transform localRect. |
493 */ | 487 */ |
494 void drawRectToRect(const GrPaint& paint, | 488 void drawRectToRect(const GrPaint& paint, |
495 const SkRect& dstRect, | 489 const SkRect& dstRect, |
496 const SkRect& localRect, | 490 const SkRect& localRect, |
497 const SkMatrix* dstMatrix = NULL, | |
498 const SkMatrix* localMatrix = NULL); | 491 const SkMatrix* localMatrix = NULL); |
499 | 492 |
500 /** | 493 /** |
501 * Draw a roundrect using a paint. | 494 * Draw a roundrect using a paint. |
502 * | 495 * |
503 * @param paint describes how to color pixels. | 496 * @param paint describes how to color pixels. |
504 * @param rrect the roundrect to draw | 497 * @param rrect the roundrect to draw |
505 * @param strokeInfo the stroke information (width, join, cap) and | 498 * @param strokeInfo the stroke information (width, join, cap) and |
506 * the dash information (intervals, count, phase). | 499 * the dash information (intervals, count, phase). |
507 */ | 500 */ |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 } | 1134 } |
1142 | 1135 |
1143 GrTexture* texture() { return fTexture; } | 1136 GrTexture* texture() { return fTexture; } |
1144 | 1137 |
1145 private: | 1138 private: |
1146 GrContext* fContext; | 1139 GrContext* fContext; |
1147 GrTexture* fTexture; | 1140 GrTexture* fTexture; |
1148 }; | 1141 }; |
1149 | 1142 |
1150 #endif | 1143 #endif |
OLD | NEW |