chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 1 | |
| 2 | /* |
| 3 | * Copyright 2012 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
| 7 | */ |
| 8 | |
| 9 | |
| 10 | #ifndef SKDEBUGCANVAS_H_ |
| 11 | #define SKDEBUGCANVAS_H_ |
| 12 | |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 13 | #include "SkCanvas.h" |
| 14 | #include "SkDrawCommand.h" |
commit-bot@chromium.org | 2a67e12 | 2014-05-19 13:53:10 +0000 | [diff] [blame] | 15 | #include "SkPathOps.h" |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 16 | #include "SkPicture.h" |
robertphillips@google.com | 8a1cdae | 2012-11-19 20:44:29 +0000 | [diff] [blame] | 17 | #include "SkTArray.h" |
chudy@google.com | 97cee97 | 2012-08-07 20:41:37 +0000 | [diff] [blame] | 18 | #include "SkString.h" |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 19 | |
robertphillips@google.com | 32bbcf8 | 2013-10-17 17:56:10 +0000 | [diff] [blame] | 20 | class SkTexOverrideFilter; |
| 21 | |
fmalita@google.com | 86681b3 | 2013-06-13 20:59:14 +0000 | [diff] [blame] | 22 | class SK_API SkDebugCanvas : public SkCanvas { |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 23 | public: |
chudy@google.com | 80a4a60 | 2012-07-30 18:54:07 +0000 | [diff] [blame] | 24 | SkDebugCanvas(int width, int height); |
robertphillips@google.com | f4741c1 | 2013-02-06 20:13:54 +0000 | [diff] [blame] | 25 | virtual ~SkDebugCanvas(); |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 26 | |
commit-bot@chromium.org | 768ac85 | 2014-03-03 16:32:17 +0000 | [diff] [blame] | 27 | void toggleFilter(bool toggle) { fFilter = toggle; } |
| 28 | |
| 29 | void setMegaVizMode(bool megaVizMode) { fMegaVizMode = megaVizMode; } |
commit-bot@chromium.org | 57f74e0 | 2014-03-25 23:31:33 +0000 | [diff] [blame] | 30 | bool getMegaVizMode() const { return fMegaVizMode; } |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 31 | |
| 32 | /** |
robertphillips@google.com | f4741c1 | 2013-02-06 20:13:54 +0000 | [diff] [blame] | 33 | * Enable or disable overdraw visualization |
| 34 | */ |
| 35 | void setOverdrawViz(bool overdrawViz) { fOverdrawViz = overdrawViz; } |
commit-bot@chromium.org | 57f74e0 | 2014-03-25 23:31:33 +0000 | [diff] [blame] | 36 | bool getOverdrawViz() const { return fOverdrawViz; } |
| 37 | |
| 38 | void setOutstandingSaveCount(int saveCount) { fOutstandingSaveCount = saveCount; } |
| 39 | int getOutstandingSaveCount() const { return fOutstandingSaveCount; } |
| 40 | |
commit-bot@chromium.org | 2a67e12 | 2014-05-19 13:53:10 +0000 | [diff] [blame] | 41 | bool getAllowSimplifyClip() const { return fAllowSimplifyClip; } |
| 42 | |
commit-bot@chromium.org | 57f74e0 | 2014-03-25 23:31:33 +0000 | [diff] [blame] | 43 | void setPicture(SkPicture* picture) { fPicture = picture; } |
robertphillips@google.com | f4741c1 | 2013-02-06 20:13:54 +0000 | [diff] [blame] | 44 | |
| 45 | /** |
robertphillips@google.com | 32bbcf8 | 2013-10-17 17:56:10 +0000 | [diff] [blame] | 46 | * Enable or disable texure filtering override |
| 47 | */ |
skia.committer@gmail.com | f84ad8f | 2013-10-18 07:01:59 +0000 | [diff] [blame] | 48 | void overrideTexFiltering(bool overrideTexFiltering, SkPaint::FilterLevel level); |
robertphillips@google.com | 32bbcf8 | 2013-10-17 17:56:10 +0000 | [diff] [blame] | 49 | |
| 50 | /** |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 51 | Executes all draw calls to the canvas. |
| 52 | @param canvas The canvas being drawn to |
| 53 | */ |
| 54 | void draw(SkCanvas* canvas); |
| 55 | |
| 56 | /** |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 57 | Executes the draw calls up to the specified index. |
| 58 | @param canvas The canvas being drawn to |
| 59 | @param index The index of the final command being executed |
| 60 | */ |
chudy@google.com | 0b5bbb0 | 2012-07-31 19:55:32 +0000 | [diff] [blame] | 61 | void drawTo(SkCanvas* canvas, int index); |
| 62 | |
| 63 | /** |
chudy@google.com | a9e937c | 2012-08-03 17:32:05 +0000 | [diff] [blame] | 64 | Returns the most recently calculated transformation matrix |
| 65 | */ |
| 66 | const SkMatrix& getCurrentMatrix() { |
| 67 | return fMatrix; |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | Returns the most recently calculated clip |
| 72 | */ |
| 73 | const SkIRect& getCurrentClip() { |
| 74 | return fClip; |
| 75 | } |
| 76 | |
| 77 | /** |
chudy@google.com | 0b5bbb0 | 2012-07-31 19:55:32 +0000 | [diff] [blame] | 78 | Returns the index of the last draw command to write to the pixel at (x,y) |
| 79 | */ |
chudy@google.com | 830b879 | 2012-08-01 15:57:52 +0000 | [diff] [blame] | 80 | int getCommandAtPoint(int x, int y, int index); |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 81 | |
| 82 | /** |
robertphillips@google.com | 50c84da | 2013-04-01 18:18:49 +0000 | [diff] [blame] | 83 | Removes the command at the specified index |
| 84 | @param index The index of the command to delete |
| 85 | */ |
| 86 | void deleteDrawCommandAt(int index); |
| 87 | |
| 88 | /** |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 89 | Returns the draw command at the given index. |
| 90 | @param index The index of the command |
| 91 | */ |
| 92 | SkDrawCommand* getDrawCommandAt(int index); |
| 93 | |
| 94 | /** |
robertphillips@google.com | 50c84da | 2013-04-01 18:18:49 +0000 | [diff] [blame] | 95 | Sets the draw command for a given index. |
| 96 | @param index The index to overwrite |
| 97 | @param command The new command |
| 98 | */ |
| 99 | void setDrawCommandAt(int index, SkDrawCommand* command); |
| 100 | |
| 101 | /** |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 102 | Returns information about the command at the given index. |
| 103 | @param index The index of the command |
| 104 | */ |
fmalita | 8c89c52 | 2014-11-08 16:18:56 -0800 | [diff] [blame^] | 105 | const SkTDArray<SkString*>* getCommandInfo(int index) const; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 106 | |
| 107 | /** |
chudy@google.com | 7e4cfbf | 2012-07-17 15:40:51 +0000 | [diff] [blame] | 108 | Returns the visibility of the command at the given index. |
| 109 | @param index The index of the command |
| 110 | */ |
| 111 | bool getDrawCommandVisibilityAt(int index); |
| 112 | |
| 113 | /** |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 114 | Returns the vector of draw commands |
| 115 | */ |
reed@google.com | 4469938 | 2013-10-31 17:28:30 +0000 | [diff] [blame] | 116 | SK_ATTR_DEPRECATED("please use getDrawCommandAt and getSize instead") |
robertphillips@google.com | 8a1cdae | 2012-11-19 20:44:29 +0000 | [diff] [blame] | 117 | const SkTDArray<SkDrawCommand*>& getDrawCommands() const; |
skia.committer@gmail.com | 2e71f16 | 2013-03-12 07:12:32 +0000 | [diff] [blame] | 118 | |
robertphillips@google.com | febc0ec | 2013-03-11 22:53:11 +0000 | [diff] [blame] | 119 | /** |
| 120 | Returns the vector of draw commands. Do not use this entry |
| 121 | point - it is going away! |
| 122 | */ |
| 123 | SkTDArray<SkDrawCommand*>& getDrawCommands(); |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 124 | |
| 125 | /** |
| 126 | * Returns the string vector of draw commands |
| 127 | */ |
robertphillips@google.com | 8a1cdae | 2012-11-19 20:44:29 +0000 | [diff] [blame] | 128 | SkTArray<SkString>* getDrawCommandsAsStrings() const; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 129 | |
| 130 | /** |
commit-bot@chromium.org | 57f74e0 | 2014-03-25 23:31:33 +0000 | [diff] [blame] | 131 | * Returns an array containing an offset (in the SkPicture) for each command |
| 132 | */ |
| 133 | SkTDArray<size_t>* getDrawCommandOffsets() const; |
| 134 | |
| 135 | /** |
chudy@google.com | f141432 | 2012-07-03 20:28:14 +0000 | [diff] [blame] | 136 | Returns length of draw command vector. |
| 137 | */ |
commit-bot@chromium.org | 0d4fe14 | 2013-07-15 22:47:14 +0000 | [diff] [blame] | 138 | int getSize() const { |
robertphillips@google.com | 67baba4 | 2013-01-02 20:20:31 +0000 | [diff] [blame] | 139 | return fCommandVector.count(); |
chudy@google.com | f141432 | 2012-07-03 20:28:14 +0000 | [diff] [blame] | 140 | } |
| 141 | |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 142 | /** |
| 143 | Toggles the visibility / execution of the draw command at index i with |
| 144 | the value of toggle. |
| 145 | */ |
| 146 | void toggleCommand(int index, bool toggle); |
| 147 | |
robertphillips | a8d7f0b | 2014-08-29 08:03:56 -0700 | [diff] [blame] | 148 | void setWindowSize(int width, int height) { fWindowSize.set(width, height); } |
chudy@google.com | b9ddd4e | 2012-07-10 14:14:50 +0000 | [diff] [blame] | 149 | |
bungeman@google.com | e8cc6e8 | 2013-01-17 16:30:56 +0000 | [diff] [blame] | 150 | void setUserMatrix(SkMatrix matrix) { |
| 151 | fUserMatrix = matrix; |
robertphillips | 7017168 | 2014-10-16 14:28:28 -0700 | [diff] [blame] | 152 | fDrawNeedsReset = true; |
chudy@google.com | 830b879 | 2012-08-01 15:57:52 +0000 | [diff] [blame] | 153 | } |
| 154 | |
commit-bot@chromium.org | 2a67e12 | 2014-05-19 13:53:10 +0000 | [diff] [blame] | 155 | SkString clipStackData() const { return fClipStackData; } |
| 156 | |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 157 | //////////////////////////////////////////////////////////////////////////////// |
| 158 | // Inherited from SkCanvas |
| 159 | //////////////////////////////////////////////////////////////////////////////// |
| 160 | |
| 161 | virtual void clear(SkColor) SK_OVERRIDE; |
| 162 | |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 163 | virtual void drawBitmap(const SkBitmap&, SkScalar left, SkScalar top, |
| 164 | const SkPaint*) SK_OVERRIDE; |
| 165 | |
reed@google.com | 7112173 | 2012-09-18 15:14:33 +0000 | [diff] [blame] | 166 | virtual void drawBitmapRectToRect(const SkBitmap&, const SkRect* src, |
commit-bot@chromium.org | eed779d | 2013-08-16 10:24:37 +0000 | [diff] [blame] | 167 | const SkRect& dst, const SkPaint* paint, |
| 168 | DrawBitmapRectFlags flags) SK_OVERRIDE; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 169 | |
| 170 | virtual void drawBitmapMatrix(const SkBitmap&, const SkMatrix&, |
| 171 | const SkPaint*) SK_OVERRIDE; |
| 172 | |
| 173 | virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, |
| 174 | const SkRect& dst, const SkPaint*) SK_OVERRIDE; |
| 175 | |
| 176 | virtual void drawData(const void*, size_t) SK_OVERRIDE; |
| 177 | |
robertphillips@google.com | 0a4805e | 2013-05-29 13:24:23 +0000 | [diff] [blame] | 178 | virtual void beginCommentGroup(const char* description) SK_OVERRIDE; |
| 179 | |
| 180 | virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE; |
| 181 | |
| 182 | virtual void endCommentGroup() SK_OVERRIDE; |
| 183 | |
robertphillips@google.com | 67baba4 | 2013-01-02 20:20:31 +0000 | [diff] [blame] | 184 | virtual void drawOval(const SkRect& oval, const SkPaint&) SK_OVERRIDE; |
| 185 | |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 186 | virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE; |
| 187 | |
bsalomon@google.com | 7ce564c | 2013-10-22 16:54:15 +0000 | [diff] [blame] | 188 | virtual void drawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE; |
| 189 | |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 190 | virtual void drawPoints(PointMode, size_t count, const SkPoint pts[], |
| 191 | const SkPaint&) SK_OVERRIDE; |
| 192 | |
bsalomon@google.com | 7ce564c | 2013-10-22 16:54:15 +0000 | [diff] [blame] | 193 | virtual void drawRect(const SkRect& rect, const SkPaint&) SK_OVERRIDE; |
| 194 | |
robertphillips@google.com | 67baba4 | 2013-01-02 20:20:31 +0000 | [diff] [blame] | 195 | virtual void drawRRect(const SkRRect& rrect, const SkPaint& paint) SK_OVERRIDE; |
| 196 | |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 197 | virtual void drawSprite(const SkBitmap&, int left, int top, |
| 198 | const SkPaint*) SK_OVERRIDE; |
| 199 | |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 200 | virtual void drawVertices(VertexMode, int vertexCount, |
robertphillips@google.com | 67baba4 | 2013-01-02 20:20:31 +0000 | [diff] [blame] | 201 | const SkPoint vertices[], const SkPoint texs[], |
| 202 | const SkColor colors[], SkXfermode*, |
| 203 | const uint16_t indices[], int indexCount, |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 204 | const SkPaint&) SK_OVERRIDE; |
| 205 | |
robertphillips@google.com | 3b0a9fe | 2013-01-31 15:56:22 +0000 | [diff] [blame] | 206 | static const int kVizImageHeight = 256; |
| 207 | static const int kVizImageWidth = 256; |
| 208 | |
robertphillips@google.com | 8f90a89 | 2014-02-28 18:19:39 +0000 | [diff] [blame] | 209 | virtual bool isClipEmpty() const SK_OVERRIDE { return false; } |
commit-bot@chromium.org | 5c70cdc | 2014-03-08 03:57:19 +0000 | [diff] [blame] | 210 | virtual bool isClipRect() const SK_OVERRIDE { return true; } |
robertphillips@google.com | 8f90a89 | 2014-02-28 18:19:39 +0000 | [diff] [blame] | 211 | virtual bool getClipBounds(SkRect* bounds) const SK_OVERRIDE { |
bsalomon | 49f085d | 2014-09-05 13:34:00 -0700 | [diff] [blame] | 212 | if (bounds) { |
skia.committer@gmail.com | 370a899 | 2014-03-01 03:02:09 +0000 | [diff] [blame] | 213 | bounds->setXYWH(0, 0, |
reed | e5ea500 | 2014-09-03 11:54:58 -0700 | [diff] [blame] | 214 | SkIntToScalar(this->imageInfo().width()), |
| 215 | SkIntToScalar(this->imageInfo().height())); |
robertphillips@google.com | 8f90a89 | 2014-02-28 18:19:39 +0000 | [diff] [blame] | 216 | } |
| 217 | return true; |
| 218 | } |
| 219 | virtual bool getClipDeviceBounds(SkIRect* bounds) const SK_OVERRIDE { |
bsalomon | 49f085d | 2014-09-05 13:34:00 -0700 | [diff] [blame] | 220 | if (bounds) { |
robertphillips@google.com | 8f90a89 | 2014-02-28 18:19:39 +0000 | [diff] [blame] | 221 | bounds->setLargest(); |
| 222 | } |
| 223 | return true; |
| 224 | } |
| 225 | |
commit-bot@chromium.org | ab58273 | 2014-02-21 12:20:45 +0000 | [diff] [blame] | 226 | protected: |
Florin Malita | 5f6102d | 2014-06-30 10:13:28 -0400 | [diff] [blame] | 227 | virtual void willSave() SK_OVERRIDE; |
commit-bot@chromium.org | e54a23f | 2014-03-12 20:21:48 +0000 | [diff] [blame] | 228 | virtual SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveFlags) SK_OVERRIDE; |
| 229 | virtual void willRestore() SK_OVERRIDE; |
| 230 | |
commit-bot@chromium.org | 44c48d0 | 2014-03-13 20:03:58 +0000 | [diff] [blame] | 231 | virtual void didConcat(const SkMatrix&) SK_OVERRIDE; |
| 232 | virtual void didSetMatrix(const SkMatrix&) SK_OVERRIDE; |
| 233 | |
commit-bot@chromium.org | ab58273 | 2014-02-21 12:20:45 +0000 | [diff] [blame] | 234 | virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK_OVERRIDE; |
reed@google.com | e0d9ce8 | 2014-04-23 04:00:17 +0000 | [diff] [blame] | 235 | virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y, |
| 236 | const SkPaint&) SK_OVERRIDE; |
| 237 | virtual void onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[], |
| 238 | const SkPaint&) SK_OVERRIDE; |
| 239 | virtual void onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[], |
| 240 | SkScalar constY, const SkPaint&) SK_OVERRIDE; |
| 241 | virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path, |
| 242 | const SkMatrix* matrix, const SkPaint&) SK_OVERRIDE; |
fmalita | b742517 | 2014-08-26 07:56:44 -0700 | [diff] [blame] | 243 | virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, |
| 244 | const SkPaint& paint) SK_OVERRIDE; |
commit-bot@chromium.org | 210ae2a | 2014-02-27 17:40:13 +0000 | [diff] [blame] | 245 | virtual void onPushCull(const SkRect& cullRect) SK_OVERRIDE; |
| 246 | virtual void onPopCull() SK_OVERRIDE; |
commit-bot@chromium.org | ab58273 | 2014-02-21 12:20:45 +0000 | [diff] [blame] | 247 | |
robertphillips@google.com | 8f90a89 | 2014-02-28 18:19:39 +0000 | [diff] [blame] | 248 | virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE; |
| 249 | virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE; |
| 250 | virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE; |
| 251 | virtual void onClipRegion(const SkRegion& region, SkRegion::Op) SK_OVERRIDE; |
| 252 | |
reed | d5fa1a4 | 2014-08-09 11:08:05 -0700 | [diff] [blame] | 253 | virtual void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) SK_OVERRIDE; |
robertphillips | 9b14f26 | 2014-06-04 05:40:44 -0700 | [diff] [blame] | 254 | |
commit-bot@chromium.org | 1643b2c | 2014-03-03 23:25:41 +0000 | [diff] [blame] | 255 | void markActiveCommands(int index); |
commit-bot@chromium.org | 768ac85 | 2014-03-03 16:32:17 +0000 | [diff] [blame] | 256 | |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 257 | private: |
robertphillips@google.com | 67baba4 | 2013-01-02 20:20:31 +0000 | [diff] [blame] | 258 | SkTDArray<SkDrawCommand*> fCommandVector; |
commit-bot@chromium.org | 57f74e0 | 2014-03-25 23:31:33 +0000 | [diff] [blame] | 259 | SkPicture* fPicture; |
robertphillips | a8d7f0b | 2014-08-29 08:03:56 -0700 | [diff] [blame] | 260 | SkISize fWindowSize; |
chudy@google.com | 7e4cfbf | 2012-07-17 15:40:51 +0000 | [diff] [blame] | 261 | bool fFilter; |
commit-bot@chromium.org | 768ac85 | 2014-03-03 16:32:17 +0000 | [diff] [blame] | 262 | bool fMegaVizMode; |
chudy@google.com | 830b879 | 2012-08-01 15:57:52 +0000 | [diff] [blame] | 263 | int fIndex; |
bungeman@google.com | e8cc6e8 | 2013-01-17 16:30:56 +0000 | [diff] [blame] | 264 | SkMatrix fUserMatrix; |
robertphillips | 7017168 | 2014-10-16 14:28:28 -0700 | [diff] [blame] | 265 | bool fDrawNeedsReset; // fUserMatrix has changed so the incremental draw won't work |
chudy@google.com | a9e937c | 2012-08-03 17:32:05 +0000 | [diff] [blame] | 266 | SkMatrix fMatrix; |
| 267 | SkIRect fClip; |
robertphillips@google.com | 32bbcf8 | 2013-10-17 17:56:10 +0000 | [diff] [blame] | 268 | |
commit-bot@chromium.org | 2a67e12 | 2014-05-19 13:53:10 +0000 | [diff] [blame] | 269 | SkString fClipStackData; |
| 270 | bool fCalledAddStackData; |
| 271 | SkPath fSaveDevPath; |
| 272 | |
robertphillips@google.com | f4741c1 | 2013-02-06 20:13:54 +0000 | [diff] [blame] | 273 | bool fOverdrawViz; |
| 274 | SkDrawFilter* fOverdrawFilter; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 275 | |
robertphillips@google.com | 32bbcf8 | 2013-10-17 17:56:10 +0000 | [diff] [blame] | 276 | bool fOverrideTexFiltering; |
| 277 | SkTexOverrideFilter* fTexOverrideFilter; |
| 278 | |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 279 | /** |
tomhudson@google.com | 0699e02 | 2012-11-27 16:09:42 +0000 | [diff] [blame] | 280 | Number of unmatched save() calls at any point during a draw. |
| 281 | If there are any saveLayer() calls outstanding, we need to resolve |
| 282 | all of them, which in practice means resolving all save() calls, |
| 283 | to avoid corruption of our canvas. |
| 284 | */ |
| 285 | int fOutstandingSaveCount; |
| 286 | |
skia.committer@gmail.com | ade9a34 | 2014-03-04 03:02:32 +0000 | [diff] [blame] | 287 | /** |
commit-bot@chromium.org | 1643b2c | 2014-03-03 23:25:41 +0000 | [diff] [blame] | 288 | The active saveLayer commands at a given point in the renderering. |
| 289 | Only used when "mega" visualization is enabled. |
| 290 | */ |
| 291 | SkTDArray<SkDrawCommand*> fActiveLayers; |
| 292 | |
skia.committer@gmail.com | ade9a34 | 2014-03-04 03:02:32 +0000 | [diff] [blame] | 293 | /** |
commit-bot@chromium.org | 1643b2c | 2014-03-03 23:25:41 +0000 | [diff] [blame] | 294 | The active cull commands at a given point in the rendering. |
| 295 | Only used when "mega" visualization is enabled. |
| 296 | */ |
| 297 | SkTDArray<SkDrawCommand*> fActiveCulls; |
| 298 | |
tomhudson@google.com | 0699e02 | 2012-11-27 16:09:42 +0000 | [diff] [blame] | 299 | /** |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 300 | Adds the command to the classes vector of commands. |
| 301 | @param command The draw command for execution |
| 302 | */ |
| 303 | void addDrawCommand(SkDrawCommand* command); |
chudy@google.com | 830b879 | 2012-08-01 15:57:52 +0000 | [diff] [blame] | 304 | |
| 305 | /** |
| 306 | Applies any panning and zooming the user has specified before |
| 307 | drawing anything else into the canvas. |
| 308 | */ |
| 309 | void applyUserTransform(SkCanvas* canvas); |
robertphillips@google.com | 3b0a9fe | 2013-01-31 15:56:22 +0000 | [diff] [blame] | 310 | |
commit-bot@chromium.org | 57f74e0 | 2014-03-25 23:31:33 +0000 | [diff] [blame] | 311 | size_t getOpID() const { |
robertphillips | ce4dd3d | 2014-07-07 13:46:35 -0700 | [diff] [blame] | 312 | #if 0 |
bsalomon | 49f085d | 2014-09-05 13:34:00 -0700 | [diff] [blame] | 313 | if (fPicture) { |
commit-bot@chromium.org | 57f74e0 | 2014-03-25 23:31:33 +0000 | [diff] [blame] | 314 | return fPicture->EXPERIMENTAL_curOpID(); |
| 315 | } |
robertphillips | ce4dd3d | 2014-07-07 13:46:35 -0700 | [diff] [blame] | 316 | #endif |
commit-bot@chromium.org | 57f74e0 | 2014-03-25 23:31:33 +0000 | [diff] [blame] | 317 | return 0; |
| 318 | } |
| 319 | |
commit-bot@chromium.org | 2a67e12 | 2014-05-19 13:53:10 +0000 | [diff] [blame] | 320 | void resetClipStackData() { fClipStackData.reset(); fCalledAddStackData = false; } |
| 321 | |
| 322 | void addClipStackData(const SkPath& devPath, const SkPath& operand, SkRegion::Op elementOp); |
| 323 | void addPathData(const SkPath& path, const char* pathName); |
| 324 | bool lastClipStackData(const SkPath& devPath); |
| 325 | void outputConicPoints(const SkPoint* pts, SkScalar weight); |
| 326 | void outputPoints(const SkPoint* pts, int count); |
| 327 | void outputPointsCommon(const SkPoint* pts, int count); |
| 328 | void outputScalar(SkScalar num); |
skia.committer@gmail.com | 3b9e8be | 2014-05-20 03:05:34 +0000 | [diff] [blame] | 329 | |
robertphillips@google.com | 3b0a9fe | 2013-01-31 15:56:22 +0000 | [diff] [blame] | 330 | typedef SkCanvas INHERITED; |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 331 | }; |
| 332 | |
| 333 | #endif |