OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #include "SkData.h" | 8 #include "SkData.h" |
9 #include "SkDumpCanvas.h" | 9 #include "SkDumpCanvas.h" |
10 #include "SkPatchUtils.h" | 10 #include "SkPatchUtils.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 str.printf("saveLayer(0x%X)", rec.fSaveLayerFlags); | 202 str.printf("saveLayer(0x%X)", rec.fSaveLayerFlags); |
203 if (rec.fBounds) { | 203 if (rec.fBounds) { |
204 str.append(" bounds"); | 204 str.append(" bounds"); |
205 toString(*rec.fBounds, &str); | 205 toString(*rec.fBounds, &str); |
206 } | 206 } |
207 const SkPaint* paint = rec.fPaint; | 207 const SkPaint* paint = rec.fPaint; |
208 if (paint) { | 208 if (paint) { |
209 if (paint->getAlpha() != 0xFF) { | 209 if (paint->getAlpha() != 0xFF) { |
210 str.appendf(" alpha:0x%02X", paint->getAlpha()); | 210 str.appendf(" alpha:0x%02X", paint->getAlpha()); |
211 } | 211 } |
212 if (paint->getXfermode()) { | 212 if (!paint->isSrcOver()) { |
213 str.appendf(" xfermode:%p", paint->getXfermode()); | 213 str.appendf(" blendmode:%d", paint->getBlendMode()); |
214 } | 214 } |
215 } | 215 } |
216 this->dump(kSave_Verb, paint, str.c_str()); | 216 this->dump(kSave_Verb, paint, str.c_str()); |
217 return this->INHERITED::getSaveLayerStrategy(rec); | 217 return this->INHERITED::getSaveLayerStrategy(rec); |
218 } | 218 } |
219 | 219 |
220 void SkDumpCanvas::willRestore() { | 220 void SkDumpCanvas::willRestore() { |
221 this->dump(kRestore_Verb, nullptr, "restore"); | 221 this->dump(kRestore_Verb, nullptr, "restore"); |
222 this->INHERITED::willRestore(); | 222 this->INHERITED::willRestore(); |
223 } | 223 } |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 #if 0 | 533 #if 0 |
534 tab.append("\t"); | 534 tab.append("\t"); |
535 #else | 535 #else |
536 tab.append(" "); // tabs are often too wide to be useful | 536 tab.append(" "); // tabs are often too wide to be useful |
537 #endif | 537 #endif |
538 } | 538 } |
539 msg.printf("%s%s", tab.c_str(), str); | 539 msg.printf("%s%s", tab.c_str(), str); |
540 | 540 |
541 if (p) { | 541 if (p) { |
542 msg.appendf(" color:0x%08X flags:%X", p->getColor(), p->getFlags()); | 542 msg.appendf(" color:0x%08X flags:%X", p->getColor(), p->getFlags()); |
| 543 if (!p->isSrcOver()) { |
| 544 msg.appendf(" blendmode:%d", p->getBlendMode()); |
| 545 } |
543 appendFlattenable(&msg, p->getShader(), "shader"); | 546 appendFlattenable(&msg, p->getShader(), "shader"); |
544 appendFlattenable(&msg, p->getXfermode(), "xfermode"); | |
545 appendFlattenable(&msg, p->getPathEffect(), "pathEffect"); | 547 appendFlattenable(&msg, p->getPathEffect(), "pathEffect"); |
546 appendFlattenable(&msg, p->getMaskFilter(), "maskFilter"); | 548 appendFlattenable(&msg, p->getMaskFilter(), "maskFilter"); |
547 appendFlattenable(&msg, p->getPathEffect(), "pathEffect"); | 549 appendFlattenable(&msg, p->getPathEffect(), "pathEffect"); |
548 appendFlattenable(&msg, p->getColorFilter(), "filter"); | 550 appendFlattenable(&msg, p->getColorFilter(), "filter"); |
549 | 551 |
550 if (SkDumpCanvas::kDrawText_Verb == verb) { | 552 if (SkDumpCanvas::kDrawText_Verb == verb) { |
551 msg.appendf(" textSize:%g", SkScalarToFloat(p->getTextSize())); | 553 msg.appendf(" textSize:%g", SkScalarToFloat(p->getTextSize())); |
552 appendPtr(&msg, p->getTypeface(), "typeface"); | 554 appendPtr(&msg, p->getTypeface(), "typeface"); |
553 } | 555 } |
554 | 556 |
555 if (p->getStyle() != SkPaint::kFill_Style) { | 557 if (p->getStyle() != SkPaint::kFill_Style) { |
556 msg.appendf(" strokeWidth:%g", SkScalarToFloat(p->getStrokeWidth()))
; | 558 msg.appendf(" strokeWidth:%g", SkScalarToFloat(p->getStrokeWidth()))
; |
557 } | 559 } |
558 } | 560 } |
559 | 561 |
560 fProc(msg.c_str(), fRefcon); | 562 fProc(msg.c_str(), fRefcon); |
561 } | 563 } |
562 | 564 |
563 /////////////////////////////////////////////////////////////////////////////// | 565 /////////////////////////////////////////////////////////////////////////////// |
564 | 566 |
565 static void dumpToDebugf(const char text[], void*) { | 567 static void dumpToDebugf(const char text[], void*) { |
566 SkDebugf("%s\n", text); | 568 SkDebugf("%s\n", text); |
567 } | 569 } |
568 | 570 |
569 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, nullptr) {} | 571 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, nullptr) {} |
OLD | NEW |