rileya@google.com | 9f5898d | 2012-09-11 20:21:44 +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 | #ifndef SkRTreeCanvas_DEFINED |
| 10 | #define SkRTreeCanvas_DEFINED |
| 11 | |
commit-bot@chromium.org | 4b32bd5 | 2013-03-15 15:06:03 +0000 | [diff] [blame] | 12 | #include "SkBBoxHierarchy.h" |
rileya@google.com | 9f5898d | 2012-09-11 20:21:44 +0000 | [diff] [blame] | 13 | #include "SkBBoxRecord.h" |
| 14 | |
| 15 | /** |
| 16 | * This records bounding box information into an SkBBoxHierarchy, and clip/transform information |
| 17 | * into an SkPictureStateTree to allow for efficient culling and correct playback of draws. |
| 18 | */ |
commit-bot@chromium.org | 4b32bd5 | 2013-03-15 15:06:03 +0000 | [diff] [blame] | 19 | class SkBBoxHierarchyRecord : public SkBBoxRecord, public SkBBoxHierarchyClient { |
rileya@google.com | 9f5898d | 2012-09-11 20:21:44 +0000 | [diff] [blame] | 20 | public: |
| 21 | /** This will take a ref of h */ |
reed@google.com | d86e7ab | 2012-09-27 20:31:31 +0000 | [diff] [blame] | 22 | SkBBoxHierarchyRecord(uint32_t recordFlags, SkBBoxHierarchy* h, |
robertphillips@google.com | 9b051a3 | 2013-08-20 20:06:40 +0000 | [diff] [blame^] | 23 | SkDevice*); |
rileya@google.com | 9f5898d | 2012-09-11 20:21:44 +0000 | [diff] [blame] | 24 | |
| 25 | virtual void handleBBox(const SkRect& bounds) SK_OVERRIDE; |
| 26 | |
skia.committer@gmail.com | a9279f0 | 2012-09-12 02:00:57 +0000 | [diff] [blame] | 27 | virtual int save(SaveFlags flags = kMatrixClip_SaveFlag) SK_OVERRIDE; |
rileya@google.com | 9f5898d | 2012-09-11 20:21:44 +0000 | [diff] [blame] | 28 | virtual int saveLayer(const SkRect* bounds, const SkPaint* paint, |
skia.committer@gmail.com | a9279f0 | 2012-09-12 02:00:57 +0000 | [diff] [blame] | 29 | SaveFlags flags = kARGB_ClipLayer_SaveFlag) SK_OVERRIDE; |
| 30 | virtual void restore() SK_OVERRIDE; |
rileya@google.com | 9f5898d | 2012-09-11 20:21:44 +0000 | [diff] [blame] | 31 | |
skia.committer@gmail.com | a9279f0 | 2012-09-12 02:00:57 +0000 | [diff] [blame] | 32 | virtual bool translate(SkScalar dx, SkScalar dy) SK_OVERRIDE; |
| 33 | virtual bool scale(SkScalar sx, SkScalar sy) SK_OVERRIDE; |
rileya@google.com | 9f5898d | 2012-09-11 20:21:44 +0000 | [diff] [blame] | 34 | virtual bool rotate(SkScalar degrees) SK_OVERRIDE; |
| 35 | virtual bool skew(SkScalar sx, SkScalar sy) SK_OVERRIDE; |
| 36 | virtual bool concat(const SkMatrix& matrix) SK_OVERRIDE; |
| 37 | virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE; |
| 38 | |
| 39 | virtual bool clipRect(const SkRect& rect, |
| 40 | SkRegion::Op op = SkRegion::kIntersect_Op, |
skia.committer@gmail.com | a9279f0 | 2012-09-12 02:00:57 +0000 | [diff] [blame] | 41 | bool doAntiAlias = false) SK_OVERRIDE; |
rileya@google.com | 9f5898d | 2012-09-11 20:21:44 +0000 | [diff] [blame] | 42 | virtual bool clipRegion(const SkRegion& region, |
skia.committer@gmail.com | a9279f0 | 2012-09-12 02:00:57 +0000 | [diff] [blame] | 43 | SkRegion::Op op = SkRegion::kIntersect_Op) SK_OVERRIDE; |
rileya@google.com | 9f5898d | 2012-09-11 20:21:44 +0000 | [diff] [blame] | 44 | virtual bool clipPath(const SkPath& path, |
| 45 | SkRegion::Op op = SkRegion::kIntersect_Op, |
skia.committer@gmail.com | a9279f0 | 2012-09-12 02:00:57 +0000 | [diff] [blame] | 46 | bool doAntiAlias = false) SK_OVERRIDE; |
junov@chromium.org | 675de16 | 2012-12-18 19:37:49 +0000 | [diff] [blame] | 47 | virtual bool clipRRect(const SkRRect& rrect, |
| 48 | SkRegion::Op op = SkRegion::kIntersect_Op, |
| 49 | bool doAntiAlias = false) SK_OVERRIDE; |
rileya@google.com | 9f5898d | 2012-09-11 20:21:44 +0000 | [diff] [blame] | 50 | |
commit-bot@chromium.org | 4b32bd5 | 2013-03-15 15:06:03 +0000 | [diff] [blame] | 51 | // Implementation of the SkBBoxHierarchyClient interface |
| 52 | virtual bool shouldRewind(void* data) SK_OVERRIDE; |
| 53 | |
rileya@google.com | 9f5898d | 2012-09-11 20:21:44 +0000 | [diff] [blame] | 54 | private: |
| 55 | typedef SkBBoxRecord INHERITED; |
| 56 | }; |
| 57 | |
| 58 | #endif |