| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 GrTRecorder_DEFINED | 8 #ifndef GrTRecorder_DEFINED |
| 9 #define GrTRecorder_DEFINED | 9 #define GrTRecorder_DEFINED |
| 10 | 10 |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 void* operator new(size_t size, GrTRecorder<TBase, TAlign>& recorder, | 371 void* operator new(size_t size, GrTRecorder<TBase, TAlign>& recorder, |
| 372 const GrTRecorderAllocWrapper<TItem>& wrapper) { | 372 const GrTRecorderAllocWrapper<TItem>& wrapper) { |
| 373 SkASSERT(size == sizeof(TItem)); | 373 SkASSERT(size == sizeof(TItem)); |
| 374 return recorder.template alloc_back<TItem>(wrapper.fDataLength); | 374 return recorder.template alloc_back<TItem>(wrapper.fDataLength); |
| 375 } | 375 } |
| 376 | 376 |
| 377 template <typename TBase, typename TAlign, typename TItem> | 377 template <typename TBase, typename TAlign, typename TItem> |
| 378 void operator delete(void*, GrTRecorder<TBase, TAlign>&, const GrTRecorderAllocW
rapper<TItem>&) { | 378 void operator delete(void*, GrTRecorder<TBase, TAlign>&, const GrTRecorderAllocW
rapper<TItem>&) { |
| 379 // We only provide an operator delete to work around compiler warnings that
can come | 379 // We only provide an operator delete to work around compiler warnings that
can come |
| 380 // up for an unmatched operator new when compiling with exceptions. | 380 // up for an unmatched operator new when compiling with exceptions. |
| 381 SK_CRASH(); | 381 SK_ABORT("Invalid Operation"); |
| 382 } | 382 } |
| 383 | 383 |
| 384 #define GrNEW_APPEND_TO_RECORDER(recorder, type_name, args) \ | 384 #define GrNEW_APPEND_TO_RECORDER(recorder, type_name, args) \ |
| 385 (new (recorder, GrTRecorderAllocWrapper<type_name>()) type_name args) | 385 (new (recorder, GrTRecorderAllocWrapper<type_name>()) type_name args) |
| 386 | 386 |
| 387 #define GrNEW_APPEND_WITH_DATA_TO_RECORDER(recorder, type_name, args, size_of_da
ta) \ | 387 #define GrNEW_APPEND_WITH_DATA_TO_RECORDER(recorder, type_name, args, size_of_da
ta) \ |
| 388 (new (recorder, GrTRecorderAllocWrapper<type_name>(recorder, size_of_data))
type_name args) | 388 (new (recorder, GrTRecorderAllocWrapper<type_name>(recorder, size_of_data))
type_name args) |
| 389 | 389 |
| 390 #endif | 390 #endif |
| OLD | NEW |