Index: debugger/SkDebugger.cpp |
diff --git a/debugger/SkDebugger.cpp b/debugger/SkDebugger.cpp |
index af6900c3f4f6aa51fcfde16996481860c6fcbdcf..fda8f9ade98c9a083554d229deef2c15b378bbfa 100644 |
--- a/debugger/SkDebugger.cpp |
+++ b/debugger/SkDebugger.cpp |
@@ -13,10 +13,8 @@ |
SkDebugger::SkDebugger() { |
// Create this some other dynamic way? |
- fDebugCanvas = new SkDebugCanvas(100, 100); |
+ fDebugCanvas = new SkDebugCanvas(0, 0); |
fPicture = NULL; |
- fPictureWidth = 0; |
- fPictureHeight = 0; |
fIndex = 0; |
} |
@@ -27,23 +25,23 @@ SkDebugger::~SkDebugger() { |
} |
void SkDebugger::loadPicture(SkPicture* picture) { |
- fPictureWidth = picture->width(); |
- fPictureHeight = picture->height(); |
+ SkRefCnt_SafeAssign(fPicture, picture); |
+ |
delete fDebugCanvas; |
- fDebugCanvas = new SkDebugCanvas(fPictureWidth, fPictureHeight); |
- fDebugCanvas->setBounds(fPictureWidth, fPictureHeight); |
+ fDebugCanvas = new SkDebugCanvas(SkScalarCeilToInt(this->pictureCull().width()), |
+ SkScalarCeilToInt(this->pictureCull().height())); |
fDebugCanvas->setPicture(picture); |
picture->draw(fDebugCanvas); |
fDebugCanvas->setPicture(NULL); |
fIndex = fDebugCanvas->getSize() - 1; |
- SkRefCnt_SafeAssign(fPicture, picture); |
} |
SkPicture* SkDebugger::copyPicture() { |
// We can't just call clone here since we want to removed the "deleted" |
// commands. Playing back will strip those out. |
SkPictureRecorder recorder; |
- SkCanvas* canvas = recorder.beginRecording(fPictureWidth, fPictureHeight, NULL, 0); |
+ SkCanvas* canvas = recorder.beginRecording(this->pictureCull().width(), |
+ this->pictureCull().height()); |
bool vizMode = fDebugCanvas->getMegaVizMode(); |
fDebugCanvas->setMegaVizMode(false); |
@@ -143,13 +141,15 @@ void SkDebugger::getOverviewText(const SkTDArray<double>* typeTimes, |
totalStr.append("<br/>"); |
overview->insert(0, totalStr); |
+ overview->append("<br/>SkPicture L: "); |
+ overview->appendScalar(this->pictureCull().fLeft); |
+ overview->append(" T: "); |
+ overview->appendScalar(this->pictureCull().fTop); |
+ overview->append(" R: "); |
+ overview->appendScalar(this->pictureCull().fRight); |
+ overview->append(" B: "); |
+ overview->appendScalar(this->pictureCull().fBottom); |
overview->append("<br/>"); |
- overview->append("SkPicture Width: "); |
- overview->appendS32(pictureWidth()); |
- overview->append("px<br/>"); |
- overview->append("SkPicture Height: "); |
- overview->appendS32(pictureHeight()); |
- overview->append("px"); |
} |
void SkDebugger::getClipStackText(SkString* clipStack) { |