OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 | 8 |
9 #ifndef GrStencilAttachment_DEFINED | 9 #ifndef GrStencilAttachment_DEFINED |
10 #define GrStencilAttachment_DEFINED | 10 #define GrStencilAttachment_DEFINED |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 fLastClipSpaceOffset != clipSpaceToStencilOffset || | 45 fLastClipSpaceOffset != clipSpaceToStencilOffset || |
46 !fLastClipStackRect.contains(clipSpaceRect); | 46 !fLastClipStackRect.contains(clipSpaceRect); |
47 } | 47 } |
48 | 48 |
49 // We create a unique stencil buffer at each width, height and sampleCnt and
share it for | 49 // We create a unique stencil buffer at each width, height and sampleCnt and
share it for |
50 // all render targets that require a stencil with those params. | 50 // all render targets that require a stencil with those params. |
51 static void ComputeSharedStencilAttachmentKey(int width, int height, int sam
pleCnt, | 51 static void ComputeSharedStencilAttachmentKey(int width, int height, int sam
pleCnt, |
52 GrUniqueKey* key); | 52 GrUniqueKey* key); |
53 | 53 |
54 protected: | 54 protected: |
55 GrStencilAttachment(GrGpu* gpu, LifeCycle lifeCycle, int width, int height,
int bits, | 55 GrStencilAttachment(GrGpu* gpu, int width, int height, int bits, |
56 int sampleCnt) | 56 int sampleCnt) |
57 : GrGpuResource(gpu, lifeCycle) | 57 : GrGpuResource(gpu) |
58 , fWidth(width) | 58 , fWidth(width) |
59 , fHeight(height) | 59 , fHeight(height) |
60 , fBits(bits) | 60 , fBits(bits) |
61 , fSampleCnt(sampleCnt) | 61 , fSampleCnt(sampleCnt) |
62 , fLastClipStackGenID(SkClipStack::kInvalidGenID) { | 62 , fLastClipStackGenID(SkClipStack::kInvalidGenID) { |
63 fLastClipStackRect.setEmpty(); | 63 fLastClipStackRect.setEmpty(); |
64 } | 64 } |
65 | 65 |
66 private: | 66 private: |
67 | 67 |
68 int fWidth; | 68 int fWidth; |
69 int fHeight; | 69 int fHeight; |
70 int fBits; | 70 int fBits; |
71 int fSampleCnt; | 71 int fSampleCnt; |
72 | 72 |
73 int32_t fLastClipStackGenID; | 73 int32_t fLastClipStackGenID; |
74 SkIRect fLastClipStackRect; | 74 SkIRect fLastClipStackRect; |
75 SkIPoint fLastClipSpaceOffset; | 75 SkIPoint fLastClipSpaceOffset; |
76 | 76 |
77 typedef GrGpuResource INHERITED; | 77 typedef GrGpuResource INHERITED; |
78 }; | 78 }; |
79 | 79 |
80 #endif | 80 #endif |
OLD | NEW |