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 |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 } | 192 } |
193 } | 193 } |
194 | 194 |
195 /////////////////////////////////////////////////////////////////////////////// | 195 /////////////////////////////////////////////////////////////////////////////// |
196 | 196 |
197 void SkDumpCanvas::willSave() { | 197 void SkDumpCanvas::willSave() { |
198 this->dump(kSave_Verb, nullptr, "save()"); | 198 this->dump(kSave_Verb, nullptr, "save()"); |
199 this->INHERITED::willSave(); | 199 this->INHERITED::willSave(); |
200 } | 200 } |
201 | 201 |
202 SkCanvas::SaveLayerStrategy SkDumpCanvas::willSaveLayer(const SkRect* bounds, co
nst SkPaint* paint, | 202 SkCanvas::SaveLayerStrategy SkDumpCanvas::getSaveLayerStrategy(const SaveLayerRe
c& rec) { |
203 SaveFlags flags) { | |
204 SkString str; | 203 SkString str; |
205 str.printf("saveLayer(0x%X)", flags); | 204 str.printf("saveLayer(0x%X)", rec.fSaveLayerFlags); |
206 if (bounds) { | 205 if (rec.fBounds) { |
207 str.append(" bounds"); | 206 str.append(" bounds"); |
208 toString(*bounds, &str); | 207 toString(*rec.fBounds, &str); |
209 } | 208 } |
| 209 const SkPaint* paint = rec.fPaint; |
210 if (paint) { | 210 if (paint) { |
211 if (paint->getAlpha() != 0xFF) { | 211 if (paint->getAlpha() != 0xFF) { |
212 str.appendf(" alpha:0x%02X", paint->getAlpha()); | 212 str.appendf(" alpha:0x%02X", paint->getAlpha()); |
213 } | 213 } |
214 if (paint->getXfermode()) { | 214 if (paint->getXfermode()) { |
215 str.appendf(" xfermode:%p", paint->getXfermode()); | 215 str.appendf(" xfermode:%p", paint->getXfermode()); |
216 } | 216 } |
217 } | 217 } |
218 this->dump(kSave_Verb, paint, str.c_str()); | 218 this->dump(kSave_Verb, paint, str.c_str()); |
219 return this->INHERITED::willSaveLayer(bounds, paint, flags); | 219 return this->INHERITED::getSaveLayerStrategy(rec); |
220 } | 220 } |
221 | 221 |
222 void SkDumpCanvas::willRestore() { | 222 void SkDumpCanvas::willRestore() { |
223 this->dump(kRestore_Verb, nullptr, "restore"); | 223 this->dump(kRestore_Verb, nullptr, "restore"); |
224 this->INHERITED::willRestore(); | 224 this->INHERITED::willRestore(); |
225 } | 225 } |
226 | 226 |
227 void SkDumpCanvas::didConcat(const SkMatrix& matrix) { | 227 void SkDumpCanvas::didConcat(const SkMatrix& matrix) { |
228 SkString str; | 228 SkString str; |
229 | 229 |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 | 541 |
542 /////////////////////////////////////////////////////////////////////////////// | 542 /////////////////////////////////////////////////////////////////////////////// |
543 | 543 |
544 static void dumpToDebugf(const char text[], void*) { | 544 static void dumpToDebugf(const char text[], void*) { |
545 SkDebugf("%s\n", text); | 545 SkDebugf("%s\n", text); |
546 } | 546 } |
547 | 547 |
548 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, nullptr) {} | 548 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, nullptr) {} |
549 | 549 |
550 #endif | 550 #endif |
OLD | NEW |