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 #ifndef GrEffect_DEFINED | 8 #ifndef GrEffect_DEFINED |
9 #define GrEffect_DEFINED | 9 #define GrEffect_DEFINED |
10 | 10 |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 * access the fragment position will be denied. | 280 * access the fragment position will be denied. |
281 */ | 281 */ |
282 void setWillReadFragmentPosition() { fWillReadFragmentPosition = true; } | 282 void setWillReadFragmentPosition() { fWillReadFragmentPosition = true; } |
283 | 283 |
284 private: | 284 private: |
285 bool isEqual(const GrEffect& other) const { | 285 bool isEqual(const GrEffect& other) const { |
286 if (&this->getFactory() != &other.getFactory()) { | 286 if (&this->getFactory() != &other.getFactory()) { |
287 return false; | 287 return false; |
288 } | 288 } |
289 bool result = this->onIsEqual(other); | 289 bool result = this->onIsEqual(other); |
290 #if GR_DEBUG | 290 #ifdef SK_DEBUG |
291 if (result) { | 291 if (result) { |
292 SkASSERT(this->numTextures() == other.numTextures()); | 292 SkASSERT(this->numTextures() == other.numTextures()); |
293 for (int i = 0; i < this->numTextures(); ++i) { | 293 for (int i = 0; i < this->numTextures(); ++i) { |
294 SkASSERT(*fTextureAccesses[i] == *other.fTextureAccesses[i]); | 294 SkASSERT(*fTextureAccesses[i] == *other.fTextureAccesses[i]); |
295 } | 295 } |
296 } | 296 } |
297 #endif | 297 #endif |
298 return result; | 298 return result; |
299 } | 299 } |
300 | 300 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 };
\ | 336 };
\ |
337 static SkAlignedSStorage<k_##NAME##_StorageSize> g_##NAME##_Storage;
\ | 337 static SkAlignedSStorage<k_##NAME##_StorageSize> g_##NAME##_Storage;
\ |
338 static void* NAME##_RefLocation = (char*)g_##NAME##_Storage.get() + k_##NAME##_E
ffectRefOffset; \ | 338 static void* NAME##_RefLocation = (char*)g_##NAME##_Storage.get() + k_##NAME##_E
ffectRefOffset; \ |
339 static GrEffect* NAME##_Effect SkNEW_PLACEMENT_ARGS(g_##NAME##_Storage.get(), EF
FECT_CLASS, ARGS);\ | 339 static GrEffect* NAME##_Effect SkNEW_PLACEMENT_ARGS(g_##NAME##_Storage.get(), EF
FECT_CLASS, ARGS);\ |
340 static SkAutoTDestroy<GrEffect> NAME##_ad(NAME##_Effect);
\ | 340 static SkAutoTDestroy<GrEffect> NAME##_ad(NAME##_Effect);
\ |
341 static GrEffectRef* NAME(GrEffect::CreateStaticEffectRef(NAME##_RefLocation, NAM
E##_Effect)); \ | 341 static GrEffectRef* NAME(GrEffect::CreateStaticEffectRef(NAME##_RefLocation, NAM
E##_Effect)); \ |
342 static SkAutoTDestroy<GrEffectRef> NAME##_Ref_ad(NAME) | 342 static SkAutoTDestroy<GrEffectRef> NAME##_Ref_ad(NAME) |
343 | 343 |
344 | 344 |
345 #endif | 345 #endif |
OLD | NEW |