Optimization: SkDebugCanvas is capable of pausing and drawing incrementally instead of redrawing all commands.
Review URL: https://codereview.appspot.com/6458056
git-svn-id: http://skia.googlecode.com/svn/trunk@4891 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/debugger/SkDebugCanvas.h b/debugger/SkDebugCanvas.h
index c13ea10..c51e40f 100644
--- a/debugger/SkDebugCanvas.h
+++ b/debugger/SkDebugCanvas.h
@@ -47,8 +47,7 @@
/**
Returns the index of the last draw command to write to the pixel at (x,y)
*/
- int getCommandAtPoint(int x, int y, int index,
- SkIPoint transform, float scale);
+ int getCommandAtPoint(int x, int y, int index);
/**
Returns the draw command at the given index.
@@ -96,6 +95,14 @@
fHeight = height;
}
+ void setUserOffset(SkIPoint offset) {
+ fUserOffset = offset;
+ }
+
+ void setUserScale(float scale) {
+ fUserScale = scale;
+ }
+
////////////////////////////////////////////////////////////////////////////////
// Inherited from SkCanvas
////////////////////////////////////////////////////////////////////////////////
@@ -181,12 +188,21 @@
int fWidth;
SkBitmap fBm;
bool fFilter;
+ int fIndex;
+ SkIPoint fUserOffset;
+ float fUserScale;
/**
Adds the command to the classes vector of commands.
@param command The draw command for execution
*/
void addDrawCommand(SkDrawCommand* command);
+
+ /**
+ Applies any panning and zooming the user has specified before
+ drawing anything else into the canvas.
+ */
+ void applyUserTransform(SkCanvas* canvas);
};
#endif