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

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

Issue 1434313002: Make all GrFragmentProcessors GL independent. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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/GrGLSLUtil.h ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "GrGLSLUtil.h"
9 #include "SkMatrix.h"
10
11 template<> void GrGLSLGetMatrix<3>(float* dest, const SkMatrix& src) {
12 // Col 0
13 dest[0] = SkScalarToFloat(src[SkMatrix::kMScaleX]);
14 dest[1] = SkScalarToFloat(src[SkMatrix::kMSkewY]);
15 dest[2] = SkScalarToFloat(src[SkMatrix::kMPersp0]);
16
17 // Col 1
18 dest[3] = SkScalarToFloat(src[SkMatrix::kMSkewX]);
19 dest[4] = SkScalarToFloat(src[SkMatrix::kMScaleY]);
20 dest[5] = SkScalarToFloat(src[SkMatrix::kMPersp1]);
21
22 // Col 2
23 dest[6] = SkScalarToFloat(src[SkMatrix::kMTransX]);
24 dest[7] = SkScalarToFloat(src[SkMatrix::kMTransY]);
25 dest[8] = SkScalarToFloat(src[SkMatrix::kMPersp2]);
26 }
27
28 template<> void GrGLSLGetMatrix<4>(float* dest, const SkMatrix& src) {
29 // Col 0
30 dest[0] = SkScalarToFloat(src[SkMatrix::kMScaleX]);
31 dest[1] = SkScalarToFloat(src[SkMatrix::kMSkewY]);
32 dest[2] = 0;
33 dest[3] = SkScalarToFloat(src[SkMatrix::kMPersp0]);
34
35 // Col 1
36 dest[4] = SkScalarToFloat(src[SkMatrix::kMSkewX]);
37 dest[5] = SkScalarToFloat(src[SkMatrix::kMScaleY]);
38 dest[6] = 0;
39 dest[7] = SkScalarToFloat(src[SkMatrix::kMPersp1]);
40
41 // Col 2
42 dest[8] = 0;
43 dest[9] = 0;
44 dest[10] = 1;
45 dest[11] = 0;
46
47 // Col 3
48 dest[12] = SkScalarToFloat(src[SkMatrix::kMTransX]);
49 dest[13] = SkScalarToFloat(src[SkMatrix::kMTransY]);
50 dest[14] = 0;
51 dest[15] = SkScalarToFloat(src[SkMatrix::kMPersp2]);
52 }
OLDNEW
« no previous file with comments | « src/gpu/glsl/GrGLSLUtil.h ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698