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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 GrRenderTarget* target = NULL); | 389 GrRenderTarget* target = NULL); |
390 | 390 |
391 /** | 391 /** |
392 * Draw everywhere (respecting the clip) with the paint. | 392 * Draw everywhere (respecting the clip) with the paint. |
393 */ | 393 */ |
394 void drawPaint(const GrPaint& paint); | 394 void drawPaint(const GrPaint& paint); |
395 | 395 |
396 /** | 396 /** |
397 * Draw the rect using a paint. | 397 * Draw the rect using a paint. |
398 * @param paint describes how to color pixels. | 398 * @param paint describes how to color pixels. |
399 * @param strokeWidth If strokeWidth < 0, then the rect is filled, else | 399 * @param stroke the stroke information (width, join, cap). |
400 * the rect is mitered stroked based on strokeWidth. If | 400 * If stroke == NULL, then the rect is filled. |
401 * strokeWidth == 0, then the stroke is always a single | 401 * Otherwise, if stroke width == 0, then the stroke |
402 * pixel thick. | 402 * is always a single pixel thick, else the rect is |
| 403 * mitered/beveled stroked based on stroke width. |
403 * @param matrix Optional matrix applied to the rect. Applied before | 404 * @param matrix Optional matrix applied to the rect. Applied before |
404 * context's matrix or the paint's matrix. | 405 * context's matrix or the paint's matrix. |
405 * The rects coords are used to access the paint (through texture matrix) | 406 * The rects coords are used to access the paint (through texture matrix) |
406 */ | 407 */ |
407 void drawRect(const GrPaint& paint, | 408 void drawRect(const GrPaint& paint, |
408 const SkRect&, | 409 const SkRect&, |
409 SkScalar strokeWidth = -1, | 410 const SkStrokeRec* stroke = NULL, |
410 const SkMatrix* matrix = NULL); | 411 const SkMatrix* matrix = NULL); |
411 | 412 |
412 /** | 413 /** |
413 * Maps a rect of local coordinates onto the a rect of destination | 414 * Maps a rect of local coordinates onto the a rect of destination |
414 * coordinates. Each rect can optionally be transformed. The localRect | 415 * coordinates. Each rect can optionally be transformed. The localRect |
415 * is stretched over the dstRect. The dstRect is transformed by the | 416 * is stretched over the dstRect. The dstRect is transformed by the |
416 * context's matrix. Additional optional matrices for both rects can be | 417 * context's matrix. Additional optional matrices for both rects can be |
417 * provided by parameters. | 418 * provided by parameters. |
418 * | 419 * |
419 * @param paint describes how to color pixels. | 420 * @param paint describes how to color pixels. |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1041 } | 1042 } |
1042 | 1043 |
1043 GrTexture* texture() { return fTexture; } | 1044 GrTexture* texture() { return fTexture; } |
1044 | 1045 |
1045 private: | 1046 private: |
1046 GrContext* fContext; | 1047 GrContext* fContext; |
1047 GrTexture* fTexture; | 1048 GrTexture* fTexture; |
1048 }; | 1049 }; |
1049 | 1050 |
1050 #endif | 1051 #endif |
OLD | NEW |