| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SKDEBUGCANVAS_H_ | 10 #ifndef SKDEBUGCANVAS_H_ |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 void setUserMatrix(SkMatrix matrix) { | 136 void setUserMatrix(SkMatrix matrix) { |
| 137 fUserMatrix = matrix; | 137 fUserMatrix = matrix; |
| 138 } | 138 } |
| 139 | 139 |
| 140 //////////////////////////////////////////////////////////////////////////////// | 140 //////////////////////////////////////////////////////////////////////////////// |
| 141 // Inherited from SkCanvas | 141 // Inherited from SkCanvas |
| 142 //////////////////////////////////////////////////////////////////////////////// | 142 //////////////////////////////////////////////////////////////////////////////// |
| 143 | 143 |
| 144 virtual void clear(SkColor) SK_OVERRIDE; | 144 virtual void clear(SkColor) SK_OVERRIDE; |
| 145 | 145 |
| 146 virtual bool clipPath(const SkPath&, SkRegion::Op, bool) SK_OVERRIDE; | |
| 147 | |
| 148 virtual bool clipRect(const SkRect&, SkRegion::Op, bool) SK_OVERRIDE; | |
| 149 | |
| 150 virtual bool clipRRect(const SkRRect& rrect, | |
| 151 SkRegion::Op op = SkRegion::kIntersect_Op, | |
| 152 bool doAntiAlias = false) SK_OVERRIDE; | |
| 153 | |
| 154 virtual bool clipRegion(const SkRegion& region, SkRegion::Op op) SK_OVERRIDE
; | |
| 155 | |
| 156 virtual bool concat(const SkMatrix& matrix) SK_OVERRIDE; | 146 virtual bool concat(const SkMatrix& matrix) SK_OVERRIDE; |
| 157 | 147 |
| 158 virtual void drawBitmap(const SkBitmap&, SkScalar left, SkScalar top, | 148 virtual void drawBitmap(const SkBitmap&, SkScalar left, SkScalar top, |
| 159 const SkPaint*) SK_OVERRIDE; | 149 const SkPaint*) SK_OVERRIDE; |
| 160 | 150 |
| 161 virtual void drawBitmapRectToRect(const SkBitmap&, const SkRect* src, | 151 virtual void drawBitmapRectToRect(const SkBitmap&, const SkRect* src, |
| 162 const SkRect& dst, const SkPaint* paint, | 152 const SkRect& dst, const SkPaint* paint, |
| 163 DrawBitmapRectFlags flags) SK_OVERRIDE; | 153 DrawBitmapRectFlags flags) SK_OVERRIDE; |
| 164 | 154 |
| 165 virtual void drawBitmapMatrix(const SkBitmap&, const SkMatrix&, | 155 virtual void drawBitmapMatrix(const SkBitmap&, const SkMatrix&, |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 | 216 |
| 227 virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE; | 217 virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE; |
| 228 | 218 |
| 229 virtual bool skew(SkScalar sx, SkScalar sy) SK_OVERRIDE; | 219 virtual bool skew(SkScalar sx, SkScalar sy) SK_OVERRIDE; |
| 230 | 220 |
| 231 virtual bool translate(SkScalar dx, SkScalar dy) SK_OVERRIDE; | 221 virtual bool translate(SkScalar dx, SkScalar dy) SK_OVERRIDE; |
| 232 | 222 |
| 233 static const int kVizImageHeight = 256; | 223 static const int kVizImageHeight = 256; |
| 234 static const int kVizImageWidth = 256; | 224 static const int kVizImageWidth = 256; |
| 235 | 225 |
| 226 virtual bool isClipEmpty() const SK_OVERRIDE { return false; } |
| 227 virtual ClipType getClipType() const SK_OVERRIDE { |
| 228 return kRect_ClipType; |
| 229 } |
| 230 virtual bool getClipBounds(SkRect* bounds) const SK_OVERRIDE { |
| 231 if (NULL != bounds) { |
| 232 bounds->setXYWH(0, 0, |
| 233 SkIntToScalar(this->imageInfo().fWidth), |
| 234 SkIntToScalar(this->imageInfo().fHeight)); |
| 235 } |
| 236 return true; |
| 237 } |
| 238 virtual bool getClipDeviceBounds(SkIRect* bounds) const SK_OVERRIDE { |
| 239 if (NULL != bounds) { |
| 240 bounds->setLargest(); |
| 241 } |
| 242 return true; |
| 243 } |
| 244 |
| 236 protected: | 245 protected: |
| 237 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK
_OVERRIDE; | 246 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK
_OVERRIDE; |
| 238 virtual void onPushCull(const SkRect& cullRect) SK_OVERRIDE; | 247 virtual void onPushCull(const SkRect& cullRect) SK_OVERRIDE; |
| 239 virtual void onPopCull() SK_OVERRIDE; | 248 virtual void onPopCull() SK_OVERRIDE; |
| 240 | 249 |
| 250 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE; |
| 251 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE
RRIDE; |
| 252 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE; |
| 253 virtual void onClipRegion(const SkRegion& region, SkRegion::Op) SK_OVERRIDE; |
| 254 |
| 241 private: | 255 private: |
| 242 SkTDArray<SkDrawCommand*> fCommandVector; | 256 SkTDArray<SkDrawCommand*> fCommandVector; |
| 243 int fWidth; | 257 int fWidth; |
| 244 int fHeight; | 258 int fHeight; |
| 245 bool fFilter; | 259 bool fFilter; |
| 246 int fIndex; | 260 int fIndex; |
| 247 SkMatrix fUserMatrix; | 261 SkMatrix fUserMatrix; |
| 248 SkMatrix fMatrix; | 262 SkMatrix fMatrix; |
| 249 SkIRect fClip; | 263 SkIRect fClip; |
| 250 | 264 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 271 /** | 285 /** |
| 272 Applies any panning and zooming the user has specified before | 286 Applies any panning and zooming the user has specified before |
| 273 drawing anything else into the canvas. | 287 drawing anything else into the canvas. |
| 274 */ | 288 */ |
| 275 void applyUserTransform(SkCanvas* canvas); | 289 void applyUserTransform(SkCanvas* canvas); |
| 276 | 290 |
| 277 typedef SkCanvas INHERITED; | 291 typedef SkCanvas INHERITED; |
| 278 }; | 292 }; |
| 279 | 293 |
| 280 #endif | 294 #endif |
| OLD | NEW |