OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 | 10 |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 } | 701 } |
702 } | 702 } |
703 | 703 |
704 /** | 704 /** |
705 * This value translates to reseting all the context state for any backend. | 705 * This value translates to reseting all the context state for any backend. |
706 */ | 706 */ |
707 static const uint32_t kAll_GrBackendState = 0xffffffff; | 707 static const uint32_t kAll_GrBackendState = 0xffffffff; |
708 | 708 |
709 /////////////////////////////////////////////////////////////////////////////// | 709 /////////////////////////////////////////////////////////////////////////////// |
710 | 710 |
| 711 #if GR_ALWAYS_ALLOCATE_ON_HEAP |
| 712 #define GrAutoMallocBaseType SkAutoMalloc |
| 713 #else |
| 714 #define GrAutoMallocBaseType SkAutoSMalloc<S> |
711 #endif | 715 #endif |
| 716 |
| 717 template <size_t S> class GrAutoMalloc : public GrAutoMallocBaseType { |
| 718 public: |
| 719 GrAutoMalloc() : INHERITED() {} |
| 720 explicit GrAutoMalloc(size_t size) : INHERITED(size) {} |
| 721 virtual ~GrAutoMalloc() {} |
| 722 private: |
| 723 typedef GrAutoMallocBaseType INHERITED; |
| 724 }; |
| 725 |
| 726 #undef GrAutoMallocBaseType |
| 727 #endif |
OLD | NEW |