Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Side by Side Diff: include/gpu/GrResourceKey.h

Issue 935863003: Use SkAutoSTMalloc in GrResourceKey (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #ifndef GrResourceKey_DEFINED 9 #ifndef GrResourceKey_DEFINED
10 #define GrResourceKey_DEFINED 10 #define GrResourceKey_DEFINED
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 void validate() const { 124 void validate() const {
125 SkASSERT(fKey[kHash_MetaDataIdx] == 125 SkASSERT(fKey[kHash_MetaDataIdx] ==
126 GrResourceKeyHash(&fKey[kHash_MetaDataIdx] + 1, 126 GrResourceKeyHash(&fKey[kHash_MetaDataIdx] + 1,
127 this->internalSize() - sizeof(uint32_t))); 127 this->internalSize() - sizeof(uint32_t)));
128 SkASSERT(SkIsAlign4(this->internalSize())); 128 SkASSERT(SkIsAlign4(this->internalSize()));
129 } 129 }
130 130
131 friend class TestResource; // For unit test to access kMetaDataCnt. 131 friend class TestResource; // For unit test to access kMetaDataCnt.
132 132
133 // bmp textures require 4 uint32_t values. 133 // bmp textures require 4 uint32_t values.
134 SkAutoSTArray<kMetaDataCnt + 4, uint32_t> fKey; 134 SkAutoSTMalloc<kMetaDataCnt + 4, uint32_t> fKey;
135 }; 135 };
136 136
137 /** 137 /**
138 * A key used for scratch resources. The key consists of a resource type (subcla ss) identifier, a 138 * A key used for scratch resources. The key consists of a resource type (subcla ss) identifier, a
139 * hash, a data length, and type-specific data. A Builder object is used to init ialize the 139 * hash, a data length, and type-specific data. A Builder object is used to init ialize the
140 * key contents. The contents must be initialized before the key can be used. 140 * key contents. The contents must be initialized before the key can be used.
141 */ 141 */
142 class GrScratchKey : public GrResourceKey { 142 class GrScratchKey : public GrResourceKey {
143 private: 143 private:
144 typedef GrResourceKey INHERITED; 144 typedef GrResourceKey INHERITED;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 GrContentKeyInvalidatedMessage(const GrContentKeyInvalidatedMessage& that) : fKey(that.fKey) {} 245 GrContentKeyInvalidatedMessage(const GrContentKeyInvalidatedMessage& that) : fKey(that.fKey) {}
246 GrContentKeyInvalidatedMessage& operator=(const GrContentKeyInvalidatedMessa ge& that) { 246 GrContentKeyInvalidatedMessage& operator=(const GrContentKeyInvalidatedMessa ge& that) {
247 fKey = that.fKey; 247 fKey = that.fKey;
248 return *this; 248 return *this;
249 } 249 }
250 const GrContentKey& key() const { return fKey; } 250 const GrContentKey& key() const { return fKey; }
251 private: 251 private:
252 GrContentKey fKey; 252 GrContentKey fKey;
253 }; 253 };
254 #endif 254 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698