| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 | 389 |
| 390 void SkDebugCanvas::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeS
tyle edgeStyle) { | 390 void SkDebugCanvas::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeS
tyle edgeStyle) { |
| 391 this->addDrawCommand(new SkClipRRectCommand(rrect, op, kSoft_ClipEdgeStyle =
= edgeStyle)); | 391 this->addDrawCommand(new SkClipRRectCommand(rrect, op, kSoft_ClipEdgeStyle =
= edgeStyle)); |
| 392 } | 392 } |
| 393 | 393 |
| 394 void SkDebugCanvas::onClipRegion(const SkRegion& region, SkRegion::Op op) { | 394 void SkDebugCanvas::onClipRegion(const SkRegion& region, SkRegion::Op op) { |
| 395 this->addDrawCommand(new SkClipRegionCommand(region, op)); | 395 this->addDrawCommand(new SkClipRegionCommand(region, op)); |
| 396 } | 396 } |
| 397 | 397 |
| 398 void SkDebugCanvas::didConcat(const SkMatrix& matrix) { | 398 void SkDebugCanvas::didConcat(const SkMatrix& matrix) { |
| 399 switch (matrix.getType()) { | 399 this->addDrawCommand(new SkConcatCommand(matrix)); |
| 400 case SkMatrix::kTranslate_Mask: | |
| 401 this->addDrawCommand(new SkTranslateCommand(matrix.getTranslateX(), | |
| 402 matrix.getTranslateY()))
; | |
| 403 break; | |
| 404 case SkMatrix::kScale_Mask: | |
| 405 this->addDrawCommand(new SkScaleCommand(matrix.getScaleX(), | |
| 406 matrix.getScaleY())); | |
| 407 break; | |
| 408 default: | |
| 409 this->addDrawCommand(new SkConcatCommand(matrix)); | |
| 410 break; | |
| 411 } | |
| 412 | |
| 413 this->INHERITED::didConcat(matrix); | 400 this->INHERITED::didConcat(matrix); |
| 414 } | 401 } |
| 415 | 402 |
| 416 void SkDebugCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar left, | 403 void SkDebugCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar left, |
| 417 SkScalar top, const SkPaint* paint) { | 404 SkScalar top, const SkPaint* paint) { |
| 418 this->addDrawCommand(new SkDrawBitmapCommand(bitmap, left, top, paint)); | 405 this->addDrawCommand(new SkDrawBitmapCommand(bitmap, left, top, paint)); |
| 419 } | 406 } |
| 420 | 407 |
| 421 void SkDebugCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src,
const SkRect& dst, | 408 void SkDebugCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src,
const SkRect& dst, |
| 422 const SkPaint* paint, DrawBitmapRectFlags f
lags) { | 409 const SkPaint* paint, DrawBitmapRectFlags f
lags) { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 const SkMatrix* matrix, const SkPaint& pain
t) { | 498 const SkMatrix* matrix, const SkPaint& pain
t) { |
| 512 this->addDrawCommand( | 499 this->addDrawCommand( |
| 513 new SkDrawTextOnPathCommand(text, byteLength, path, matrix, paint)); | 500 new SkDrawTextOnPathCommand(text, byteLength, path, matrix, paint)); |
| 514 } | 501 } |
| 515 | 502 |
| 516 void SkDebugCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar
y, | 503 void SkDebugCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar
y, |
| 517 const SkPaint& paint) { | 504 const SkPaint& paint) { |
| 518 this->addDrawCommand(new SkDrawTextBlobCommand(blob, x, y, paint)); | 505 this->addDrawCommand(new SkDrawTextBlobCommand(blob, x, y, paint)); |
| 519 } | 506 } |
| 520 | 507 |
| 508 void SkDebugCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4
], |
| 509 const SkPoint texCoords[4], SkXfermode* xmode, |
| 510 const SkPaint& paint) { |
| 511 this->addDrawCommand(new SkDrawPatchCommand(cubics, colors, texCoords, xmode
, paint)); |
| 512 } |
| 513 |
| 521 void SkDebugCanvas::onDrawVertices(VertexMode vmode, int vertexCount, const SkPo
int vertices[], | 514 void SkDebugCanvas::onDrawVertices(VertexMode vmode, int vertexCount, const SkPo
int vertices[], |
| 522 const SkPoint texs[], const SkColor colors[], | 515 const SkPoint texs[], const SkColor colors[], |
| 523 SkXfermode*, const uint16_t indices[], int in
dexCount, | 516 SkXfermode*, const uint16_t indices[], int in
dexCount, |
| 524 const SkPaint& paint) { | 517 const SkPaint& paint) { |
| 525 this->addDrawCommand(new SkDrawVerticesCommand(vmode, vertexCount, vertices, | 518 this->addDrawCommand(new SkDrawVerticesCommand(vmode, vertexCount, vertices, |
| 526 texs, colors, NULL, indices, indexCount, paint)); | 519 texs, colors, NULL, indices, indexCount, paint)); |
| 527 } | 520 } |
| 528 | 521 |
| 529 void SkDebugCanvas::willRestore() { | 522 void SkDebugCanvas::willRestore() { |
| 530 this->addDrawCommand(new SkRestoreCommand()); | 523 this->addDrawCommand(new SkRestoreCommand()); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 } | 664 } |
| 672 | 665 |
| 673 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { | 666 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { |
| 674 if (fCalledAddStackData) { | 667 if (fCalledAddStackData) { |
| 675 fClipStackData.appendf("<br>"); | 668 fClipStackData.appendf("<br>"); |
| 676 addPathData(devPath, "pathOut"); | 669 addPathData(devPath, "pathOut"); |
| 677 return true; | 670 return true; |
| 678 } | 671 } |
| 679 return false; | 672 return false; |
| 680 } | 673 } |
| OLD | NEW |