Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: include/core/SkClipStack.h

Issue 894693003: Add refcnting to SkClipStack on SkCanvas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: feedback inc Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/core/SkCanvas.h ('k') | include/gpu/GrClipData.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 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 #ifndef SkClipStack_DEFINED 8 #ifndef SkClipStack_DEFINED
9 #define SkClipStack_DEFINED 9 #define SkClipStack_DEFINED
10 10
11 #include "SkDeque.h" 11 #include "SkDeque.h"
12 #include "SkPath.h" 12 #include "SkPath.h"
13 #include "SkRect.h" 13 #include "SkRect.h"
14 #include "SkRRect.h" 14 #include "SkRRect.h"
15 #include "SkRegion.h" 15 #include "SkRegion.h"
16 #include "SkTDArray.h" 16 #include "SkTDArray.h"
17 #include "SkTLazy.h" 17 #include "SkTLazy.h"
18 18
19 class SkCanvasClipVisitor; 19 class SkCanvasClipVisitor;
20 20
21 // Because a single save/restore state can have multiple clips, this class 21 // Because a single save/restore state can have multiple clips, this class
22 // stores the stack depth (fSaveCount) and clips (fDeque) separately. 22 // stores the stack depth (fSaveCount) and clips (fDeque) separately.
23 // Each clip in fDeque stores the stack state to which it belongs 23 // Each clip in fDeque stores the stack state to which it belongs
24 // (i.e., the fSaveCount in force when it was added). Restores are thus 24 // (i.e., the fSaveCount in force when it was added). Restores are thus
25 // implemented by removing clips from fDeque that have an fSaveCount larger 25 // implemented by removing clips from fDeque that have an fSaveCount larger
26 // then the freshly decremented count. 26 // then the freshly decremented count.
27 class SK_API SkClipStack { 27 class SK_API SkClipStack : public SkNVRefCnt<SkClipStack> {
28 public: 28 public:
29 enum BoundsType { 29 enum BoundsType {
30 // The bounding box contains all the pixels that can be written to 30 // The bounding box contains all the pixels that can be written to
31 kNormal_BoundsType, 31 kNormal_BoundsType,
32 // The bounding box contains all the pixels that cannot be written to. 32 // The bounding box contains all the pixels that cannot be written to.
33 // The real bound extends out to infinity and all the pixels outside 33 // The real bound extends out to infinity and all the pixels outside
34 // of the bound can be written to. Note that some of the pixels inside 34 // of the bound can be written to. Note that some of the pixels inside
35 // the bound may also be writeable but all pixels that cannot be 35 // the bound may also be writeable but all pixels that cannot be
36 // written to are guaranteed to be inside. 36 // written to are guaranteed to be inside.
37 kInsideOut_BoundsType 37 kInsideOut_BoundsType
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 */ 476 */
477 void restoreTo(int saveCount); 477 void restoreTo(int saveCount);
478 478
479 /** 479 /**
480 * Return the next unique generation ID. 480 * Return the next unique generation ID.
481 */ 481 */
482 static int32_t GetNextGenID(); 482 static int32_t GetNextGenID();
483 }; 483 };
484 484
485 #endif 485 #endif
OLDNEW
« no previous file with comments | « include/core/SkCanvas.h ('k') | include/gpu/GrClipData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698