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

Side by Side Diff: include/gpu/GrClipData.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/SkClipStack.h ('k') | include/gpu/GrContext.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 * Copyright 2010 Google Inc. 2 * Copyright 2010 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrClip_DEFINED 8 #ifndef GrClip_DEFINED
9 #define GrClip_DEFINED 9 #define GrClip_DEFINED
10 10
11 #include "SkClipStack.h" 11 #include "SkClipStack.h"
12 #include "GrSurface.h" 12 #include "GrSurface.h"
13 13
14 struct SkIRect; 14 struct SkIRect;
15 15
16 /** 16 /**
17 * GrClipData encapsulates the information required to construct the clip 17 * GrClipData encapsulates the information required to construct the clip
18 * masks. 'fOrigin' is only non-zero when saveLayer has been called 18 * masks. 'fOrigin' is only non-zero when saveLayer has been called
19 * with an offset bounding box. The clips in 'fClipStack' are in 19 * with an offset bounding box. The clips in 'fClipStack' are in
20 * device coordinates (i.e., they have been translated by -fOrigin w.r.t. 20 * device coordinates (i.e., they have been translated by -fOrigin w.r.t.
21 * the canvas' device coordinates). 21 * the canvas' device coordinates).
22 */ 22 */
23 class GrClipData : SkNoncopyable { 23 class GrClipData : SkNoncopyable {
24 public: 24 public:
25 const SkClipStack* fClipStack; 25 SkAutoTUnref<const SkClipStack> fClipStack;
26 SkIPoint fOrigin; 26 SkIPoint fOrigin;
27 27
28 GrClipData() 28 GrClipData()
29 : fClipStack(NULL) { 29 : fClipStack(NULL) {
30 fOrigin.setZero(); 30 fOrigin.setZero();
31 } 31 }
32 32
33 bool operator==(const GrClipData& other) const { 33 bool operator==(const GrClipData& other) const {
34 if (fOrigin != other.fOrigin) { 34 if (fOrigin != other.fOrigin) {
35 return false; 35 return false;
36 } 36 }
(...skipping 15 matching lines...) Expand all
52 this->getConservativeBounds(surface->width(), surface->height(), 52 this->getConservativeBounds(surface->width(), surface->height(),
53 devResult, isIntersectionOfRects); 53 devResult, isIntersectionOfRects);
54 } 54 }
55 55
56 void getConservativeBounds(int width, int height, 56 void getConservativeBounds(int width, int height,
57 SkIRect* devResult, 57 SkIRect* devResult,
58 bool* isIntersectionOfRects = NULL) const; 58 bool* isIntersectionOfRects = NULL) const;
59 }; 59 };
60 60
61 #endif 61 #endif
OLDNEW
« no previous file with comments | « include/core/SkClipStack.h ('k') | include/gpu/GrContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698