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

Unified Diff: src/sksl/ir/SkSLSwizzle.h

Issue 2143323003: Revert of SkSL performance improvements (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/sksl/ir/SkSLProgram.h ('k') | src/sksl/ir/SkSLSymbolTable.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/sksl/ir/SkSLSwizzle.h
diff --git a/src/sksl/ir/SkSLSwizzle.h b/src/sksl/ir/SkSLSwizzle.h
index fad71b8114cc92480b49e9fa9d869c5106ddaa00..ce360d18471c88546990d8042fc731d37fd36bcb 100644
--- a/src/sksl/ir/SkSLSwizzle.h
+++ b/src/sksl/ir/SkSLSwizzle.h
@@ -18,40 +18,41 @@
* instance, swizzling a vec3 with two components will result in a vec2. It is possible to swizzle
* with more components than the source vector, as in 'vec2(1).xxxx'.
*/
-static const Type& get_type(Expression& value, size_t count) {
- const Type& base = value.fType.componentType();
+static std::shared_ptr<Type> get_type(Expression& value,
+ size_t count) {
+ std::shared_ptr<Type> base = value.fType->componentType();
if (count == 1) {
return base;
}
- if (base == *kFloat_Type) {
+ if (base == kFloat_Type) {
switch (count) {
- case 2: return *kVec2_Type;
- case 3: return *kVec3_Type;
- case 4: return *kVec4_Type;
+ case 2: return kVec2_Type;
+ case 3: return kVec3_Type;
+ case 4: return kVec4_Type;
}
- } else if (base == *kDouble_Type) {
+ } else if (base == kDouble_Type) {
switch (count) {
- case 2: return *kDVec2_Type;
- case 3: return *kDVec3_Type;
- case 4: return *kDVec4_Type;
+ case 2: return kDVec2_Type;
+ case 3: return kDVec3_Type;
+ case 4: return kDVec4_Type;
}
- } else if (base == *kInt_Type) {
+ } else if (base == kInt_Type) {
switch (count) {
- case 2: return *kIVec2_Type;
- case 3: return *kIVec3_Type;
- case 4: return *kIVec4_Type;
+ case 2: return kIVec2_Type;
+ case 3: return kIVec3_Type;
+ case 4: return kIVec4_Type;
}
- } else if (base == *kUInt_Type) {
+ } else if (base == kUInt_Type) {
switch (count) {
- case 2: return *kUVec2_Type;
- case 3: return *kUVec3_Type;
- case 4: return *kUVec4_Type;
+ case 2: return kUVec2_Type;
+ case 3: return kUVec3_Type;
+ case 4: return kUVec4_Type;
}
- } else if (base == *kBool_Type) {
+ } else if (base == kBool_Type) {
switch (count) {
- case 2: return *kBVec2_Type;
- case 3: return *kBVec3_Type;
- case 4: return *kBVec4_Type;
+ case 2: return kBVec2_Type;
+ case 3: return kBVec3_Type;
+ case 4: return kBVec4_Type;
}
}
ABORT("cannot swizzle %s\n", value.description().c_str());
« no previous file with comments | « src/sksl/ir/SkSLProgram.h ('k') | src/sksl/ir/SkSLSymbolTable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698