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

Unified Diff: src/utils/debugger/SkDebugCanvas.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 | « src/utils/debugger/SkDebugCanvas.h ('k') | src/utils/debugger/SkDrawCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/debugger/SkDebugCanvas.cpp
diff --git a/src/utils/debugger/SkDebugCanvas.cpp b/src/utils/debugger/SkDebugCanvas.cpp
index 2b0eab7f32504eb1ea43c0ec27755af637db362e..85fb7a4ee0f3c6bbb25b46eebf340ffb4660b830 100644
--- a/src/utils/debugger/SkDebugCanvas.cpp
+++ b/src/utils/debugger/SkDebugCanvas.cpp
@@ -14,11 +14,10 @@
#include "SkDevice.h"
#include "SkXfermode.h"
-SkDebugCanvas::SkDebugCanvas(int width, int height)
- : INHERITED(width, height)
+SkDebugCanvas::SkDebugCanvas(int windowWidth, int windowHeight)
+ : INHERITED(windowWidth, windowHeight)
, fPicture(NULL)
- , fWidth(width)
- , fHeight(height)
+ , fWindowSize(SkISize::Make(windowWidth, windowHeight))
, fFilter(false)
, fMegaVizMode(false)
, fIndex(0)
@@ -76,7 +75,7 @@ int SkDebugCanvas::getCommandAtPoint(int x, int y, int index) {
SkCanvas canvas(bitmap);
canvas.translate(SkIntToScalar(-x), SkIntToScalar(-y));
- applyUserTransform(&canvas);
+ this->applyUserTransform(&canvas);
int layer = 0;
SkColor prev = bitmap.getColor(0,0);
@@ -255,10 +254,10 @@ void SkDebugCanvas::drawTo(SkCanvas* canvas, int index) {
}
canvas->clear(SK_ColorTRANSPARENT);
canvas->resetMatrix();
- SkRect rect = SkRect::MakeWH(SkIntToScalar(fWidth),
- SkIntToScalar(fHeight));
- canvas->clipRect(rect, SkRegion::kReplace_Op );
- applyUserTransform(canvas);
+ SkRect rect = SkRect::MakeWH(SkIntToScalar(fWindowSize.fWidth),
+ SkIntToScalar(fWindowSize.fHeight));
+ canvas->clipRect(rect, SkRegion::kReplace_Op);
+ this->applyUserTransform(canvas);
fOutstandingSaveCount = 0;
}
@@ -292,17 +291,7 @@ void SkDebugCanvas::drawTo(SkCanvas* canvas, int index) {
for (; i <= index; i++) {
if (i == index && fFilter) {
- SkPaint p;
- p.setColor(0xAAFFFFFF);
- canvas->save();
- canvas->resetMatrix();
- SkRect mask;
- mask.set(SkIntToScalar(0), SkIntToScalar(0),
- SkIntToScalar(fWidth), SkIntToScalar(fHeight));
- canvas->clipRect(mask, SkRegion::kReplace_Op, false);
- canvas->drawRectCoords(SkIntToScalar(0), SkIntToScalar(0),
- SkIntToScalar(fWidth), SkIntToScalar(fHeight), p);
- canvas->restore();
+ canvas->clear(0xAAFFFFFF);
}
if (fCommandVector[i]->isVisible()) {
@@ -321,12 +310,13 @@ void SkDebugCanvas::drawTo(SkCanvas* canvas, int index) {
}
if (fMegaVizMode) {
- SkRect r = SkRect::MakeWH(SkIntToScalar(fWidth), SkIntToScalar(fHeight));
+ SkRect r = SkRect::MakeWH(SkIntToScalar(fWindowSize.fWidth),
+ SkIntToScalar(fWindowSize.fHeight));
r.outset(SK_Scalar1, SK_Scalar1);
canvas->save();
// nuke the CTM
- canvas->setMatrix(SkMatrix::I());
+ canvas->resetMatrix();
// turn off clipping
canvas->clipRect(r, SkRegion::kReplace_Op);
« no previous file with comments | « src/utils/debugger/SkDebugCanvas.h ('k') | src/utils/debugger/SkDrawCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698