| 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 #include "GrStencilSettings.h" | 9 #include "GrStencilSettings.h" |
| 10 | 10 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 GR_STATIC_ASSERT(9 == (int)GrUserStencilOp::kSetClipBit); | 163 GR_STATIC_ASSERT(9 == (int)GrUserStencilOp::kSetClipBit); |
| 164 GR_STATIC_ASSERT(10 == (int)GrUserStencilOp::kInvertClipBit); | 164 GR_STATIC_ASSERT(10 == (int)GrUserStencilOp::kInvertClipBit); |
| 165 GR_STATIC_ASSERT(11 == (int)GrUserStencilOp::kSetClipAndReplaceUserBits); | 165 GR_STATIC_ASSERT(11 == (int)GrUserStencilOp::kSetClipAndReplaceUserBits); |
| 166 GR_STATIC_ASSERT(12 == (int)GrUserStencilOp::kZeroClipAndUserBits); | 166 GR_STATIC_ASSERT(12 == (int)GrUserStencilOp::kZeroClipAndUserBits); |
| 167 | 167 |
| 168 void GrStencilSettings::Face::reset(const GrUserStencilSettings::Face& user, boo
l hasStencilClip, | 168 void GrStencilSettings::Face::reset(const GrUserStencilSettings::Face& user, boo
l hasStencilClip, |
| 169 int numStencilBits) { | 169 int numStencilBits) { |
| 170 SkASSERT(user.fTest < (GrUserStencilTest)kGrUserStencilTestCount); | 170 SkASSERT(user.fTest < (GrUserStencilTest)kGrUserStencilTestCount); |
| 171 SkASSERT(user.fPassOp < (GrUserStencilOp)kGrUserStencilOpCount); | 171 SkASSERT(user.fPassOp < (GrUserStencilOp)kGrUserStencilOpCount); |
| 172 SkASSERT(user.fFailOp < (GrUserStencilOp)kGrUserStencilOpCount); | 172 SkASSERT(user.fFailOp < (GrUserStencilOp)kGrUserStencilOpCount); |
| 173 SkASSERT(numStencilBits <= 16); | 173 SkASSERT(numStencilBits > 0 && numStencilBits <= 16); |
| 174 int clipBit = 1 << (numStencilBits - 1); | 174 int clipBit = 1 << (numStencilBits - 1); |
| 175 int userMask = clipBit - 1; | 175 int userMask = clipBit - 1; |
| 176 | 176 |
| 177 GrUserStencilOp maxOp = SkTMax(user.fPassOp, user.fFailOp); | 177 GrUserStencilOp maxOp = SkTMax(user.fPassOp, user.fFailOp); |
| 178 SkDEBUGCODE(GrUserStencilOp otherOp = SkTMin(user.fPassOp, user.fFailOp);) | 178 SkDEBUGCODE(GrUserStencilOp otherOp = SkTMin(user.fPassOp, user.fFailOp);) |
| 179 if (maxOp <= kLastUserOnlyStencilOp) { | 179 if (maxOp <= kLastUserOnlyStencilOp) { |
| 180 // Ops that only modify user bits. | 180 // Ops that only modify user bits. |
| 181 fWriteMask = user.fWriteMask & userMask; | 181 fWriteMask = user.fWriteMask & userMask; |
| 182 SkASSERT(otherOp <= kLastUserOnlyStencilOp); | 182 SkASSERT(otherOp <= kLastUserOnlyStencilOp); |
| 183 } else if (maxOp <= kLastClipOnlyStencilOp) { | 183 } else if (maxOp <= kLastClipOnlyStencilOp) { |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 GR_STATIC_ASSERT(4 == offsetof(Face, fTestMask)); | 480 GR_STATIC_ASSERT(4 == offsetof(Face, fTestMask)); |
| 481 GR_STATIC_ASSERT(2 == sizeof(Face::fTestMask)); | 481 GR_STATIC_ASSERT(2 == sizeof(Face::fTestMask)); |
| 482 GR_STATIC_ASSERT(6 == offsetof(Face, fPassOp)); | 482 GR_STATIC_ASSERT(6 == offsetof(Face, fPassOp)); |
| 483 GR_STATIC_ASSERT(1 == sizeof(Face::fPassOp)); | 483 GR_STATIC_ASSERT(1 == sizeof(Face::fPassOp)); |
| 484 GR_STATIC_ASSERT(7 == offsetof(Face, fFailOp)); | 484 GR_STATIC_ASSERT(7 == offsetof(Face, fFailOp)); |
| 485 GR_STATIC_ASSERT(1 == sizeof(Face::fFailOp)); | 485 GR_STATIC_ASSERT(1 == sizeof(Face::fFailOp)); |
| 486 GR_STATIC_ASSERT(8 == offsetof(Face, fWriteMask)); | 486 GR_STATIC_ASSERT(8 == offsetof(Face, fWriteMask)); |
| 487 GR_STATIC_ASSERT(2 == sizeof(Face::fWriteMask)); | 487 GR_STATIC_ASSERT(2 == sizeof(Face::fWriteMask)); |
| 488 GR_STATIC_ASSERT(10 == sizeof(Face)); | 488 GR_STATIC_ASSERT(10 == sizeof(Face)); |
| 489 } | 489 } |
| OLD | NEW |