Greg Daniel | c0d6915 | 2020-10-08 14:59:00 -0400 | [diff] [blame] | 1 | /* |
| 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 | |
| 12 | void 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 | } |