blob: be463a0ccf675f68ca011e4e3ec855afc0643ab9 [file] [log] [blame]
bsalomon@google.com558a75b2011-08-08 17:01:14 +00001
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"
bsalomon7775c852014-12-30 12:50:52 -080010#include "GrResourceKey.h"
bsalomon@google.com558a75b2011-08-08 17:01:14 +000011
bsalomon7775c852014-12-30 12:50:52 -080012void 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.com46a86002012-08-08 10:42:44 +000019}