| OLD | NEW |
| 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 | 8 |
| 9 | 9 |
| 10 #include "GrStencil.h" | 10 #include "GrStencil.h" |
| 11 | 11 |
| 12 #include "GrProcessor.h" |
| 13 |
| 12 //////////////////////////////////////////////////////////////////////////////// | 14 //////////////////////////////////////////////////////////////////////////////// |
| 13 // Stencil Rules for Merging user stencil space into clip | 15 // Stencil Rules for Merging user stencil space into clip |
| 14 | 16 |
| 15 // We can't include the clip bit in the ref or mask values because the division | 17 // We can't include the clip bit in the ref or mask values because the division |
| 16 // between user and clip bits in the stencil depends on the number of stencil | 18 // between user and clip bits in the stencil depends on the number of stencil |
| 17 // bits in the runtime. Comments below indicate what the code should do to | 19 // bits in the runtime. Comments below indicate what the code should do to |
| 18 // incorporate the clip bit into these settings. | 20 // incorporate the clip bit into these settings. |
| 19 | 21 |
| 20 /////// | 22 /////// |
| 21 // Replace | 23 // Replace |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 settings[1].fFuncMasks[kFront_Face]; | 388 settings[1].fFuncMasks[kFront_Face]; |
| 387 settings[1].fFuncRefs[kBack_Face] = | 389 settings[1].fFuncRefs[kBack_Face] = |
| 388 settings[1].fFuncRefs[kFront_Face]; | 390 settings[1].fFuncRefs[kFront_Face]; |
| 389 } | 391 } |
| 390 break; | 392 break; |
| 391 default: | 393 default: |
| 392 SkFAIL("Unknown set op"); | 394 SkFAIL("Unknown set op"); |
| 393 } | 395 } |
| 394 return false; | 396 return false; |
| 395 } | 397 } |
| 398 |
| 399 void GrStencilSettings::genKey(GrProcessorKeyBuilder* b) const { |
| 400 static const int kCount = sizeof(GrStencilSettings) / sizeof(uint32_t); |
| 401 GR_STATIC_ASSERT(0 == sizeof(GrStencilSettings) % sizeof(uint32_t)); |
| 402 uint32_t* key = b->add32n(kCount); |
| 403 memcpy(key, this, sizeof(GrStencilSettings)); |
| 404 } |
| OLD | NEW |