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

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

Issue 882223003: Move npot resizing out of GrContext and simplify GrContext texture functions. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase 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);
223 // add the inner key to the end of the key so that op[] can be index ed normally. 224 // add the inner key to the end of the key so that op[] can be index ed normally.
224 uint32_t* innerKeyData = &this->operator[](extraData32Cnt); 225 uint32_t* innerKeyData = &this->operator[](extraData32Cnt);
225 const uint32_t* srcData = innerKey.data(); 226 const uint32_t* srcData = innerKey.data();
226 (*innerKeyData++) = innerKey.domain(); 227 (*innerKeyData++) = innerKey.domain();
227 memcpy(innerKeyData, srcData, innerKey.dataSize()); 228 memcpy(innerKeyData, srcData, innerKey.dataSize());
228 } 229 }
229 230
230 private: 231 private:
231 static int Data32CntForInnerKey(const GrContentKey& innerKey) { 232 static int Data32CntForInnerKey(const GrContentKey& innerKey) {
232 // key data + domain 233 // key data + domain
233 return SkToInt((innerKey.dataSize() >> 2) + 1); 234 return SkToInt((innerKey.dataSize() >> 2) + 1);
234 } 235 }
235 }; 236 };
236 }; 237 };
237 238
238 #endif 239 #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