blob: 6217444c1ba366e7f164eee4f5af69909a99cd39 [file] [log] [blame]
Greg Danielc0d69152020-10-08 14:59:00 -04001/*
2 * Copyright 2011 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#include "src/gpu/GrAttachment.h"
9
10#include "include/private/GrResourceKey.h"
11
12void GrAttachment::ComputeSharedAttachmentUniqueKey(SkISize dimensions,
13 UsageFlags requiredUsage,
14 int sampleCnt,
15 GrUniqueKey* key) {
16 static const GrUniqueKey::Domain kDomain = GrUniqueKey::GenerateDomain();
17
18 GrUniqueKey::Builder builder(key, kDomain, 4);
19 builder[0] = dimensions.width();
20 builder[1] = dimensions.height();
21 builder[2] = (uint32_t)requiredUsage;
22 builder[3] = sampleCnt;
23}