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

Unified Diff: src/utils/debugger/SkDebugCanvas.cpp

Issue 660883002: "Fix" debugger's setMatrix handling (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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.h » ('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 85fb7a4ee0f3c6bbb25b46eebf340ffb4660b830..684c5cd17b76bf072f110c07bc4f0dc4dd8c9f33 100644
--- a/src/utils/debugger/SkDebugCanvas.cpp
+++ b/src/utils/debugger/SkDebugCanvas.cpp
@@ -27,6 +27,7 @@ SkDebugCanvas::SkDebugCanvas(int windowWidth, int windowHeight)
, fTexOverrideFilter(NULL)
, fOutstandingSaveCount(0) {
fUserMatrix.reset();
+ fDrawNeedsReset = false;
// SkPicturePlayback uses the base-class' quickReject calls to cull clipped
// operations. This can lead to problems in the debugger which expects all
@@ -81,6 +82,7 @@ int SkDebugCanvas::getCommandAtPoint(int x, int y, int index) {
SkColor prev = bitmap.getColor(0,0);
for (int i = 0; i < index; i++) {
if (fCommandVector[i]->isVisible()) {
+ fCommandVector[i]->setUserMatrix(fUserMatrix);
fCommandVector[i]->execute(&canvas);
}
if (prev != bitmap.getColor(0,0)) {
@@ -246,7 +248,7 @@ void SkDebugCanvas::drawTo(SkCanvas* canvas, int index) {
// and restores.
// The visibility filter also requires a full re-draw - otherwise we can
// end up drawing the filter repeatedly.
- if (fIndex < index && !fFilter && !fMegaVizMode && !pathOpsMode) {
+ if (fIndex < index && !fFilter && !fMegaVizMode && !pathOpsMode && !fDrawNeedsReset) {
i = fIndex + 1;
} else {
for (int j = 0; j < fOutstandingSaveCount; j++) {
@@ -254,10 +256,11 @@ void SkDebugCanvas::drawTo(SkCanvas* canvas, int index) {
}
canvas->clear(SK_ColorTRANSPARENT);
canvas->resetMatrix();
- SkRect rect = SkRect::MakeWH(SkIntToScalar(fWindowSize.fWidth),
+ SkRect rect = SkRect::MakeWH(SkIntToScalar(fWindowSize.fWidth),
SkIntToScalar(fWindowSize.fHeight));
canvas->clipRect(rect, SkRegion::kReplace_Op);
this->applyUserTransform(canvas);
+ fDrawNeedsReset = false;
fOutstandingSaveCount = 0;
}
@@ -302,6 +305,7 @@ void SkDebugCanvas::drawTo(SkCanvas* canvas, int index) {
// All active culls draw their cull box
fCommandVector[i]->vizExecute(canvas);
} else {
+ fCommandVector[i]->setUserMatrix(fUserMatrix);
fCommandVector[i]->execute(canvas);
}
« no previous file with comments | « src/utils/debugger/SkDebugCanvas.h ('k') | src/utils/debugger/SkDrawCommand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698