bsalomon@google.com | 558a75b | 2011-08-08 17:01:14 +0000 | [diff] [blame] | 1 | |
| 2 | /* |
| 3 | * Copyright 2011 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
| 7 | */ |
| 8 | |
| 9 | #include "GrStencilBuffer.h" |
bsalomon | 7775c85 | 2014-12-30 12:50:52 -0800 | [diff] [blame] | 10 | #include "GrResourceKey.h" |
bsalomon@google.com | 558a75b | 2011-08-08 17:01:14 +0000 | [diff] [blame] | 11 | |
bsalomon | 7775c85 | 2014-12-30 12:50:52 -0800 | [diff] [blame] | 12 | void GrStencilBuffer::ComputeKey(int width, int height, int sampleCnt, GrScratchKey* key) { |
| 13 | static const GrScratchKey::ResourceType kType = GrScratchKey::GenerateResourceType(); |
| 14 | GrScratchKey::Builder builder(key, kType, 2); |
| 15 | SkASSERT(width <= SK_MaxU16); |
| 16 | SkASSERT(height <= SK_MaxU16); |
| 17 | builder[0] = width | (height << 16); |
| 18 | builder[1] = sampleCnt; |
robertphillips@google.com | 46a8600 | 2012-08-08 10:42:44 +0000 | [diff] [blame] | 19 | } |