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

Side by Side Diff: src/gpu/GrTestUtils.cpp

Issue 1117443002: create GrTestUtils.h, move some common functions into it (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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') | src/gpu/effects/GrBezierEffect.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 "GrTestUtils.h"
9 #include "SkMatrix.h"
10
11 namespace GrTest {
12 const SkMatrix& TestMatrix(SkRandom* random) {
13 static SkMatrix gMatrices[5];
14 static bool gOnce;
15 if (!gOnce) {
16 gMatrices[0].reset();
17 gMatrices[1].setTranslate(SkIntToScalar(-100), SkIntToScalar(100));
18 gMatrices[2].setRotate(SkIntToScalar(17));
19 gMatrices[3].setRotate(SkIntToScalar(185));
20 gMatrices[3].postTranslate(SkIntToScalar(66), SkIntToScalar(-33));
21 gMatrices[3].postScale(SkIntToScalar(2), SK_ScalarHalf);
22 gMatrices[4].setRotate(SkIntToScalar(215));
23 gMatrices[4].set(SkMatrix::kMPersp0, 0.00013f);
24 gMatrices[4].set(SkMatrix::kMPersp1, -0.000039f);
25 gOnce = true;
26 }
27 return gMatrices[random->nextULessThan(static_cast<uint32_t>(SK_ARRAY_COUNT( gMatrices)))];
28 }
29 };
OLDNEW
« no previous file with comments | « src/gpu/GrProcessor.cpp ('k') | src/gpu/effects/GrBezierEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698