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

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

Issue 2131223002: SkSL performance improvements (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: fixed windows build error 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
Index: src/sksl/ir/SkSLIndexExpression.h
diff --git a/src/sksl/ir/SkSLIndexExpression.h b/src/sksl/ir/SkSLIndexExpression.h
index 538c656153ad42929bb411ef49fd85d215b6e848..cf993de8354f8108127407eaf34d8450153172f8 100644
--- a/src/sksl/ir/SkSLIndexExpression.h
+++ b/src/sksl/ir/SkSLIndexExpression.h
@@ -16,7 +16,7 @@ namespace SkSL {
/**
* Given a type, returns the type that will result from extracting an array value from it.
*/
-static std::shared_ptr<Type> index_type(const Type& type) {
+static const Type& index_type(const Type& type) {
if (type.kind() == Type::kMatrix_Kind) {
if (type.componentType() == kFloat_Type) {
switch (type.columns()) {
@@ -43,7 +43,7 @@ static std::shared_ptr<Type> index_type(const Type& type) {
*/
struct IndexExpression : public Expression {
IndexExpression(std::unique_ptr<Expression> base, std::unique_ptr<Expression> index)
- : INHERITED(base->fPosition, kIndex_Kind, index_type(*base->fType))
+ : INHERITED(base->fPosition, kIndex_Kind, index_type(base->fType))
, fBase(std::move(base))
, fIndex(std::move(index)) {
ASSERT(fIndex->fType == kInt_Type);

Powered by Google App Engine
This is Rietveld 408576698