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

Side by Side Diff: src/gpu/glsl/GrGLSLProgramDataManager.cpp

Issue 2329553002: Cleanup GPU gamut transformation code (Closed)
Patch Set: Switch from float[16] to SkMatrix44 Created 4 years, 3 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/glsl/GrGLSLProgramDataManager.h ('k') | src/gpu/glsl/GrGLSLShaderBuilder.cpp » ('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 * Copyright 2016 Google Inc. 2 * Copyright 2016 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 "glsl/GrGLSLProgramDataManager.h" 8 #include "glsl/GrGLSLProgramDataManager.h"
9 9
10 #include "SkMatrix.h" 10 #include "SkMatrix.h"
11 #include "SkMatrix44.h"
11 12
12 void GrGLSLProgramDataManager::setSkMatrix(UniformHandle u, const SkMatrix& matr ix) const { 13 void GrGLSLProgramDataManager::setSkMatrix(UniformHandle u, const SkMatrix& matr ix) const {
13 float mt[] = { 14 float mt[] = {
14 matrix.get(SkMatrix::kMScaleX), 15 matrix.get(SkMatrix::kMScaleX),
15 matrix.get(SkMatrix::kMSkewY), 16 matrix.get(SkMatrix::kMSkewY),
16 matrix.get(SkMatrix::kMPersp0), 17 matrix.get(SkMatrix::kMPersp0),
17 matrix.get(SkMatrix::kMSkewX), 18 matrix.get(SkMatrix::kMSkewX),
18 matrix.get(SkMatrix::kMScaleY), 19 matrix.get(SkMatrix::kMScaleY),
19 matrix.get(SkMatrix::kMPersp1), 20 matrix.get(SkMatrix::kMPersp1),
20 matrix.get(SkMatrix::kMTransX), 21 matrix.get(SkMatrix::kMTransX),
21 matrix.get(SkMatrix::kMTransY), 22 matrix.get(SkMatrix::kMTransY),
22 matrix.get(SkMatrix::kMPersp2), 23 matrix.get(SkMatrix::kMPersp2),
23 }; 24 };
24 this->setMatrix3f(u, mt); 25 this->setMatrix3f(u, mt);
25 } 26 }
27
28 void GrGLSLProgramDataManager::setSkMatrix44(UniformHandle u, const SkMatrix44& matrix) const {
29 // TODO: We could skip this temporary buffer if we had direct access to the matrix storage
30 float m[16];
31 matrix.asColMajorf(m);
32 this->setMatrix4f(u, m);
33 }
OLDNEW
« no previous file with comments | « src/gpu/glsl/GrGLSLProgramDataManager.h ('k') | src/gpu/glsl/GrGLSLShaderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698