| 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 #ifndef SkBBoxRecord_DEFINED | 9 #ifndef SkBBoxRecord_DEFINED |
| 10 #define SkBBoxRecord_DEFINED | 10 #define SkBBoxRecord_DEFINED |
| 11 | 11 |
| 12 #include "SkPictureRecord.h" | 12 #include "SkPictureRecord.h" |
| 13 | 13 |
| 14 /** | 14 /** |
| 15 * This is an abstract SkPictureRecord subclass that intercepts draw calls and
computes an | 15 * This is an abstract SkPictureRecord subclass that intercepts draw calls and
computes an |
| 16 * axis-aligned bounding box for each draw that it sees, subclasses implement h
andleBBox() | 16 * axis-aligned bounding box for each draw that it sees, subclasses implement h
andleBBox() |
| 17 * which will be called every time we get a new bounding box. | 17 * which will be called every time we get a new bounding box. |
| 18 */ | 18 */ |
| 19 class SkBBoxRecord : public SkPictureRecord { | 19 class SkBBoxRecord : public SkPictureRecord { |
| 20 public: | 20 public: |
| 21 | 21 |
| 22 SkBBoxRecord(uint32_t recordFlags, SkBaseDevice* device) | 22 SkBBoxRecord(const SkISize& size, uint32_t recordFlags) : INHERITED(size, re
cordFlags) {} |
| 23 : INHERITED(recordFlags, device) { } | |
| 24 virtual ~SkBBoxRecord() { } | 23 virtual ~SkBBoxRecord() { } |
| 25 | 24 |
| 26 /** | 25 /** |
| 27 * This is called each time we get a bounding box, it will be axis-aligned, | 26 * This is called each time we get a bounding box, it will be axis-aligned, |
| 28 * in device coordinates, and expanded to include stroking, shadows, etc. | 27 * in device coordinates, and expanded to include stroking, shadows, etc. |
| 29 */ | 28 */ |
| 30 virtual void handleBBox(const SkRect& bbox) = 0; | 29 virtual void handleBBox(const SkRect& bbox) = 0; |
| 31 | 30 |
| 32 virtual void drawOval(const SkRect& rect, const SkPaint& paint) SK_OVERRIDE; | 31 virtual void drawOval(const SkRect& rect, const SkPaint& paint) SK_OVERRIDE; |
| 33 virtual void drawRRect(const SkRRect& rrect, const SkPaint& paint) SK_OVERRI
DE; | 32 virtual void drawRRect(const SkRRect& rrect, const SkPaint& paint) SK_OVERRI
DE; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 * Takes a bounding box in current canvas view space, accounts for stroking
and effects, and | 69 * Takes a bounding box in current canvas view space, accounts for stroking
and effects, and |
| 71 * computes an axis-aligned bounding box in device coordinates, then passes
it to handleBBox() | 70 * computes an axis-aligned bounding box in device coordinates, then passes
it to handleBBox() |
| 72 * returns false if the draw is completely clipped out, and may safely be ig
nored. | 71 * returns false if the draw is completely clipped out, and may safely be ig
nored. |
| 73 **/ | 72 **/ |
| 74 bool transformBounds(const SkRect& bounds, const SkPaint* paint); | 73 bool transformBounds(const SkRect& bounds, const SkPaint* paint); |
| 75 | 74 |
| 76 typedef SkPictureRecord INHERITED; | 75 typedef SkPictureRecord INHERITED; |
| 77 }; | 76 }; |
| 78 | 77 |
| 79 #endif | 78 #endif |
| OLD | NEW |