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

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

Issue 85463005: remove SkFloatToScalar macro (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add flag to expose SkFloatToScalar to chromium Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « src/gpu/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/GrPathUtils.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 2012 Google Inc. 2 * Copyright 2012 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 "GrEffect.h" 8 #include "GrEffect.h"
9 #include "GrBackendEffectFactory.h" 9 #include "GrBackendEffectFactory.h"
10 #include "GrContext.h" 10 #include "GrContext.h"
(...skipping 15 matching lines...) Expand all
26 static SkMatrix gMatrices[5]; 26 static SkMatrix gMatrices[5];
27 static bool gOnce; 27 static bool gOnce;
28 if (!gOnce) { 28 if (!gOnce) {
29 gMatrices[0].reset(); 29 gMatrices[0].reset();
30 gMatrices[1].setTranslate(SkIntToScalar(-100), SkIntToScalar(100)); 30 gMatrices[1].setTranslate(SkIntToScalar(-100), SkIntToScalar(100));
31 gMatrices[2].setRotate(SkIntToScalar(17)); 31 gMatrices[2].setRotate(SkIntToScalar(17));
32 gMatrices[3].setRotate(SkIntToScalar(185)); 32 gMatrices[3].setRotate(SkIntToScalar(185));
33 gMatrices[3].postTranslate(SkIntToScalar(66), SkIntToScalar(-33)); 33 gMatrices[3].postTranslate(SkIntToScalar(66), SkIntToScalar(-33));
34 gMatrices[3].postScale(SkIntToScalar(2), SK_ScalarHalf); 34 gMatrices[3].postScale(SkIntToScalar(2), SK_ScalarHalf);
35 gMatrices[4].setRotate(SkIntToScalar(215)); 35 gMatrices[4].setRotate(SkIntToScalar(215));
36 gMatrices[4].set(SkMatrix::kMPersp0, SkFloatToScalar(0.00013f)); 36 gMatrices[4].set(SkMatrix::kMPersp0, 0.00013f);
37 gMatrices[4].set(SkMatrix::kMPersp1, SkFloatToScalar(-0.000039f)); 37 gMatrices[4].set(SkMatrix::kMPersp1, -0.000039f);
38 gOnce = true; 38 gOnce = true;
39 } 39 }
40 return gMatrices[random->nextULessThan(static_cast<uint32_t>(SK_ARRAY_COUNT( gMatrices)))]; 40 return gMatrices[random->nextULessThan(static_cast<uint32_t>(SK_ARRAY_COUNT( gMatrices)))];
41 } 41 }
42 } 42 }
43 43
44 class GrEffect_Globals { 44 class GrEffect_Globals {
45 public: 45 public:
46 static GrMemoryPool* GetTLS() { 46 static GrMemoryPool* GetTLS() {
47 return (GrMemoryPool*)SkTLS::Get(CreateTLS, DeleteTLS); 47 return (GrMemoryPool*)SkTLS::Get(CreateTLS, DeleteTLS);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 SkASSERT(this->numTransforms() == other.numTransforms()); 109 SkASSERT(this->numTransforms() == other.numTransforms());
110 for (int i = 0; i < this->numTransforms(); ++i) { 110 for (int i = 0; i < this->numTransforms(); ++i) {
111 SkASSERT(this->coordTransform(i) == other.coordTransform(i)); 111 SkASSERT(this->coordTransform(i) == other.coordTransform(i));
112 } 112 }
113 SkASSERT(this->numTextures() == other.numTextures()); 113 SkASSERT(this->numTextures() == other.numTextures());
114 for (int i = 0; i < this->numTextures(); ++i) { 114 for (int i = 0; i < this->numTextures(); ++i) {
115 SkASSERT(this->textureAccess(i) == other.textureAccess(i)); 115 SkASSERT(this->textureAccess(i) == other.textureAccess(i));
116 } 116 }
117 } 117 }
118 #endif 118 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/GrPathUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698