OLD | NEW |
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" |
11 #include "GrMemoryPool.h" | 11 #include "GrMemoryPool.h" |
12 #include "SkTLS.h" | 12 #include "SkTLS.h" |
13 | 13 |
14 SK_DEFINE_INST_COUNT(GrEffect) | 14 SK_DEFINE_INST_COUNT(GrEffect) |
15 | 15 |
16 #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS | 16 #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS |
17 SkTArray<GrEffectTestFactory*, true>* GrEffectTestFactory::GetFactories() { | 17 SkTArray<GrEffectTestFactory*, true>* GrEffectTestFactory::GetFactories() { |
18 static SkTArray<GrEffectTestFactory*, true> gFactories; | 18 static SkTArray<GrEffectTestFactory*, true> gFactories; |
19 return &gFactories; | 19 return &gFactories; |
20 } | 20 } |
21 #endif | 21 #endif |
22 | 22 |
23 namespace GrEffectUnitTest { | 23 namespace GrEffectUnitTest { |
24 const SkMatrix& TestMatrix(SkMWCRandom* random) { | 24 const SkMatrix& TestMatrix(SkRandom* random) { |
25 static SkMatrix gMatrices[5]; | 25 static SkMatrix gMatrices[5]; |
26 static bool gOnce; | 26 static bool gOnce; |
27 if (!gOnce) { | 27 if (!gOnce) { |
28 gMatrices[0].reset(); | 28 gMatrices[0].reset(); |
29 gMatrices[1].setTranslate(SkIntToScalar(-100), SkIntToScalar(100)); | 29 gMatrices[1].setTranslate(SkIntToScalar(-100), SkIntToScalar(100)); |
30 gMatrices[2].setRotate(SkIntToScalar(17)); | 30 gMatrices[2].setRotate(SkIntToScalar(17)); |
31 gMatrices[3].setRotate(SkIntToScalar(185)); | 31 gMatrices[3].setRotate(SkIntToScalar(185)); |
32 gMatrices[3].postTranslate(SkIntToScalar(66), SkIntToScalar(-33)); | 32 gMatrices[3].postTranslate(SkIntToScalar(66), SkIntToScalar(-33)); |
33 gMatrices[3].postScale(SkIntToScalar(2), SK_ScalarHalf); | 33 gMatrices[3].postScale(SkIntToScalar(2), SK_ScalarHalf); |
34 gMatrices[4].setRotate(SkIntToScalar(215)); | 34 gMatrices[4].setRotate(SkIntToScalar(215)); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 fVertexAttribTypes.push_back(type); | 95 fVertexAttribTypes.push_back(type); |
96 } | 96 } |
97 | 97 |
98 void* GrEffect::operator new(size_t size) { | 98 void* GrEffect::operator new(size_t size) { |
99 return GrEffect_Globals::GetTLS()->allocate(size); | 99 return GrEffect_Globals::GetTLS()->allocate(size); |
100 } | 100 } |
101 | 101 |
102 void GrEffect::operator delete(void* target) { | 102 void GrEffect::operator delete(void* target) { |
103 GrEffect_Globals::GetTLS()->release(target); | 103 GrEffect_Globals::GetTLS()->release(target); |
104 } | 104 } |
OLD | NEW |