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

Unified Diff: debugger/SkDebugger.cpp

Issue 513983002: Try out scalar picture sizes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT again Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « debugger/SkDebugger.h ('k') | dm/DMPDFTask.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « debugger/SkDebugger.h ('k') | dm/DMPDFTask.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698