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

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

Issue 887303002: Revert of Move npot resizing out of GrContext and simplify GrContext texture functions. (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 | « include/gpu/GrPaint.h ('k') | include/gpu/GrTypes.h » ('j') | 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 213
214 class Builder : public INHERITED::Builder { 214 class Builder : public INHERITED::Builder {
215 public: 215 public:
216 Builder(GrContentKey* key, Domain domain, int data32Count) 216 Builder(GrContentKey* key, Domain domain, int data32Count)
217 : INHERITED::Builder(key, domain, data32Count) {} 217 : INHERITED::Builder(key, domain, data32Count) {}
218 218
219 /** Used to build a key that wraps another key and adds additional data. */ 219 /** Used to build a key that wraps another key and adds additional data. */
220 Builder(GrContentKey* key, const GrContentKey& innerKey, Domain domain, 220 Builder(GrContentKey* key, const GrContentKey& innerKey, Domain domain,
221 int extraData32Cnt) 221 int extraData32Cnt)
222 : INHERITED::Builder(key, domain, Data32CntForInnerKey(innerKey) + e xtraData32Cnt) { 222 : INHERITED::Builder(key, domain, Data32CntForInnerKey(innerKey) + e xtraData32Cnt) {
223 SkASSERT(&innerKey != key);
224 // add the inner key to the end of the key so that op[] can be index ed normally. 223 // add the inner key to the end of the key so that op[] can be index ed normally.
225 uint32_t* innerKeyData = &this->operator[](extraData32Cnt); 224 uint32_t* innerKeyData = &this->operator[](extraData32Cnt);
226 const uint32_t* srcData = innerKey.data(); 225 const uint32_t* srcData = innerKey.data();
227 (*innerKeyData++) = innerKey.domain(); 226 (*innerKeyData++) = innerKey.domain();
228 memcpy(innerKeyData, srcData, innerKey.dataSize()); 227 memcpy(innerKeyData, srcData, innerKey.dataSize());
229 } 228 }
230 229
231 private: 230 private:
232 static int Data32CntForInnerKey(const GrContentKey& innerKey) { 231 static int Data32CntForInnerKey(const GrContentKey& innerKey) {
233 // key data + domain 232 // key data + domain
234 return SkToInt((innerKey.dataSize() >> 2) + 1); 233 return SkToInt((innerKey.dataSize() >> 2) + 1);
235 } 234 }
236 }; 235 };
237 }; 236 };
238 237
239 #endif 238 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrPaint.h ('k') | include/gpu/GrTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698