aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrStencilBuffer.cpp
blob: be463a0ccf675f68ca011e4e3ec855afc0643ab9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

/*
 * Copyright 2011 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "GrStencilBuffer.h"
#include "GrResourceKey.h"

void GrStencilBuffer::ComputeKey(int width, int height, int sampleCnt, GrScratchKey* key) {
    static const GrScratchKey::ResourceType kType = GrScratchKey::GenerateResourceType();
    GrScratchKey::Builder builder(key, kType, 2);
    SkASSERT(width <= SK_MaxU16);
    SkASSERT(height <= SK_MaxU16);
    builder[0] = width | (height << 16);
    builder[1] = sampleCnt;
}