| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 #include "SkDumpCanvas.h" | 9 #include "SkDumpCanvas.h" |
| 10 | 10 |
| 11 #ifdef SK_DEVELOPER | 11 #ifdef SK_DEVELOPER |
| 12 #include "SkPatchUtils.h" | 12 #include "SkPatchUtils.h" |
| 13 #include "SkPicture.h" | 13 #include "SkPicture.h" |
| 14 #include "SkPixelRef.h" | 14 #include "SkPixelRef.h" |
| 15 #include "SkRRect.h" | 15 #include "SkRRect.h" |
| 16 #include "SkString.h" | 16 #include "SkString.h" |
| 17 #include "SkTextBlob.h" |
| 17 #include <stdarg.h> | 18 #include <stdarg.h> |
| 18 #include <stdio.h> | 19 #include <stdio.h> |
| 19 | 20 |
| 20 // needed just to know that these are all subclassed from SkFlattenable | 21 // needed just to know that these are all subclassed from SkFlattenable |
| 21 #include "SkShader.h" | 22 #include "SkShader.h" |
| 22 #include "SkPathEffect.h" | 23 #include "SkPathEffect.h" |
| 23 #include "SkXfermode.h" | 24 #include "SkXfermode.h" |
| 24 #include "SkColorFilter.h" | 25 #include "SkColorFilter.h" |
| 25 #include "SkPathEffect.h" | 26 #include "SkPathEffect.h" |
| 26 #include "SkMaskFilter.h" | 27 #include "SkMaskFilter.h" |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 } | 417 } |
| 417 | 418 |
| 418 void SkDumpCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const S
kPath& path, | 419 void SkDumpCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const S
kPath& path, |
| 419 const SkMatrix* matrix, const SkPaint& paint
) { | 420 const SkMatrix* matrix, const SkPaint& paint
) { |
| 420 SkString str; | 421 SkString str; |
| 421 toString(text, byteLength, paint.getTextEncoding(), &str); | 422 toString(text, byteLength, paint.getTextEncoding(), &str); |
| 422 this->dump(kDrawText_Verb, &paint, "drawTextOnPath(%s [%d])", | 423 this->dump(kDrawText_Verb, &paint, "drawTextOnPath(%s [%d])", |
| 423 str.c_str(), byteLength); | 424 str.c_str(), byteLength); |
| 424 } | 425 } |
| 425 | 426 |
| 427 void SkDumpCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y
, |
| 428 const SkPaint& paint) { |
| 429 SkString str; |
| 430 toString(blob->bounds(), &str); |
| 431 this->dump(kDrawText_Verb, &paint, "drawTextBlob(%p) [%s]", blob, str.c_str(
)); |
| 432 // FIXME: dump the actual blob content? |
| 433 } |
| 434 |
| 426 void SkDumpCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matri
x, | 435 void SkDumpCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matri
x, |
| 427 const SkPaint* paint) { | 436 const SkPaint* paint) { |
| 428 this->dump(kDrawPicture_Verb, NULL, "drawPicture(%p) %d:%d", picture, | 437 this->dump(kDrawPicture_Verb, NULL, "drawPicture(%p) %d:%d", picture, |
| 429 picture->width(), picture->height()); | 438 picture->width(), picture->height()); |
| 430 fNestLevel += 1; | 439 fNestLevel += 1; |
| 431 this->INHERITED::onDrawPicture(picture, matrix, paint); | 440 this->INHERITED::onDrawPicture(picture, matrix, paint); |
| 432 fNestLevel -= 1; | 441 fNestLevel -= 1; |
| 433 this->dump(kDrawPicture_Verb, NULL, "endPicture(%p) %d:%d", &picture, | 442 this->dump(kDrawPicture_Verb, NULL, "endPicture(%p) %d:%d", &picture, |
| 434 picture->width(), picture->height()); | 443 picture->width(), picture->height()); |
| 435 } | 444 } |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 | 550 |
| 542 /////////////////////////////////////////////////////////////////////////////// | 551 /////////////////////////////////////////////////////////////////////////////// |
| 543 | 552 |
| 544 static void dumpToDebugf(const char text[], void*) { | 553 static void dumpToDebugf(const char text[], void*) { |
| 545 SkDebugf("%s\n", text); | 554 SkDebugf("%s\n", text); |
| 546 } | 555 } |
| 547 | 556 |
| 548 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, NULL) {} | 557 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, NULL) {} |
| 549 | 558 |
| 550 #endif | 559 #endif |
| OLD | NEW |