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

Side by Side Diff: src/gpu/gl/GrGLProgramDesc.cpp

Issue 659803005: Last round of effect->processor (for now) (Closed) Base URL: https://skia.googlesource.com/skia.git@factory
Patch Set: fixed Created 6 years, 2 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 | « src/gpu/GrProcessor.cpp ('k') | 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 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "gl/builders/GrGLFragmentShaderBuilder.h" 8 #include "gl/builders/GrGLFragmentShaderBuilder.h"
9 #include "GrGLProgramDesc.h" 9 #include "GrGLProgramDesc.h"
10 #include "GrBackendProcessorFactory.h" 10 #include "GrBackendProcessorFactory.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 uint16_t* processorKeySize) { 126 uint16_t* processorKeySize) {
127 const GrBackendProcessorFactory& factory = proc.getFactory(); 127 const GrBackendProcessorFactory& factory = proc.getFactory();
128 factory.getGLProcessorKey(proc, caps, b); 128 factory.getGLProcessorKey(proc, caps, b);
129 size_t size = b->size(); 129 size_t size = b->size();
130 if (size > SK_MaxU16) { 130 if (size > SK_MaxU16) {
131 *processorKeySize = 0; // suppresses a warning. 131 *processorKeySize = 0; // suppresses a warning.
132 return false; 132 return false;
133 } 133 }
134 *processorKeySize = SkToU16(size); 134 *processorKeySize = SkToU16(size);
135 uint32_t textureKey = gen_texture_key(proc, caps); 135 uint32_t textureKey = gen_texture_key(proc, caps);
136 uint32_t classID = proc.getFactory().effectClassID(); 136 uint32_t classID = proc.getFactory().classID();
137 137
138 // Currently we allow 16 bits for each of the above portions of the meta-key . Fail if they 138 // Currently we allow 16 bits for each of the above portions of the meta-key . Fail if they
139 // don't fit. 139 // don't fit.
140 static const uint32_t kMetaKeyInvalidMask = ~((uint32_t) SK_MaxU16); 140 static const uint32_t kMetaKeyInvalidMask = ~((uint32_t) SK_MaxU16);
141 if ((textureKey | transformKey | classID) & kMetaKeyInvalidMask) { 141 if ((textureKey | transformKey | classID) & kMetaKeyInvalidMask) {
142 return false; 142 return false;
143 } 143 }
144 144
145 uint32_t* key = b->add32n(2); 145 uint32_t* key = b->add32n(2);
146 key[0] = (textureKey << 16 | transformKey); 146 key[0] = (textureKey << 16 | transformKey);
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 *checksum = 0; 354 *checksum = 0;
355 *checksum = SkChecksum::Compute(reinterpret_cast<uint32_t*>(fKey.begin()), k eyLength); 355 *checksum = SkChecksum::Compute(reinterpret_cast<uint32_t*>(fKey.begin()), k eyLength);
356 } 356 }
357 357
358 GrGLProgramDesc& GrGLProgramDesc::operator= (const GrGLProgramDesc& other) { 358 GrGLProgramDesc& GrGLProgramDesc::operator= (const GrGLProgramDesc& other) {
359 size_t keyLength = other.keyLength(); 359 size_t keyLength = other.keyLength();
360 fKey.reset(keyLength); 360 fKey.reset(keyLength);
361 memcpy(fKey.begin(), other.fKey.begin(), keyLength); 361 memcpy(fKey.begin(), other.fKey.begin(), keyLength);
362 return *this; 362 return *this;
363 } 363 }
OLDNEW
« no previous file with comments | « src/gpu/GrProcessor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698