Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: debugger/SkDebugger.cpp

Issue 540963002: Change SkPicture::draw to playback (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "SkDebugger.h" 9 #include "SkDebugger.h"
10 #include "SkPictureRecorder.h" 10 #include "SkPictureRecorder.h"
(...skipping 13 matching lines...) Expand all
24 SkSafeUnref(fPicture); 24 SkSafeUnref(fPicture);
25 } 25 }
26 26
27 void SkDebugger::loadPicture(SkPicture* picture) { 27 void SkDebugger::loadPicture(SkPicture* picture) {
28 SkRefCnt_SafeAssign(fPicture, picture); 28 SkRefCnt_SafeAssign(fPicture, picture);
29 29
30 delete fDebugCanvas; 30 delete fDebugCanvas;
31 fDebugCanvas = new SkDebugCanvas(SkScalarCeilToInt(this->pictureCull().width ()), 31 fDebugCanvas = new SkDebugCanvas(SkScalarCeilToInt(this->pictureCull().width ()),
32 SkScalarCeilToInt(this->pictureCull().heigh t())); 32 SkScalarCeilToInt(this->pictureCull().heigh t()));
33 fDebugCanvas->setPicture(picture); 33 fDebugCanvas->setPicture(picture);
34 picture->draw(fDebugCanvas); 34 picture->playback(fDebugCanvas);
35 fDebugCanvas->setPicture(NULL); 35 fDebugCanvas->setPicture(NULL);
36 fIndex = fDebugCanvas->getSize() - 1; 36 fIndex = fDebugCanvas->getSize() - 1;
37 } 37 }
38 38
39 SkPicture* SkDebugger::copyPicture() { 39 SkPicture* SkDebugger::copyPicture() {
40 // We can't just call clone here since we want to removed the "deleted" 40 // We can't just call clone here since we want to removed the "deleted"
41 // commands. Playing back will strip those out. 41 // commands. Playing back will strip those out.
42 SkPictureRecorder recorder; 42 SkPictureRecorder recorder;
43 SkCanvas* canvas = recorder.beginRecording(this->pictureCull().width(), 43 SkCanvas* canvas = recorder.beginRecording(this->pictureCull().width(),
44 this->pictureCull().height()); 44 this->pictureCull().height());
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 overview->append(" R: "); 148 overview->append(" R: ");
149 overview->appendScalar(this->pictureCull().fRight); 149 overview->appendScalar(this->pictureCull().fRight);
150 overview->append(" B: "); 150 overview->append(" B: ");
151 overview->appendScalar(this->pictureCull().fBottom); 151 overview->appendScalar(this->pictureCull().fBottom);
152 overview->append("<br/>"); 152 overview->append("<br/>");
153 } 153 }
154 154
155 void SkDebugger::getClipStackText(SkString* clipStack) { 155 void SkDebugger::getClipStackText(SkString* clipStack) {
156 clipStack->set(fDebugCanvas->clipStackData()); 156 clipStack->set(fDebugCanvas->clipStackData());
157 } 157 }
OLDNEW
« no previous file with comments | « bench/nanobench.cpp ('k') | dm/DMPDFTask.cpp » ('j') | include/core/SkPicture.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698