Index: cc/paint/paint_op_buffer.h |
diff --git a/cc/paint/paint_op_buffer.h b/cc/paint/paint_op_buffer.h |
index db9eaadcf22c8c8ffb89e4005e94ebb5f23d9718..fadc00088c60d441e3e3ef358cc053675b0b352d 100644 |
--- a/cc/paint/paint_op_buffer.h |
+++ b/cc/paint/paint_op_buffer.h |
@@ -209,10 +209,10 @@ struct CC_PAINT_EXPORT PaintOpWithArray : PaintOpWithArrayBase { |
// if T is aligned, and M's alignment needs are a multiple of T's size, then |
// M will also be aligned when placed immediately after T. |
static_assert( |
- sizeof(T) % ALIGNOF(M) == 0, |
+ sizeof(T) % alignof(M) == 0, |
"T must be padded such that an array of M is aligned after it"); |
static_assert( |
- ALIGNOF(T) >= ALIGNOF(M), |
+ alignof(T) >= alignof(M), |
"T must have not have less alignment requirements than the array data"); |
return reinterpret_cast<const M*>(op + 1); |
} |
@@ -771,7 +771,7 @@ class CC_PAINT_EXPORT PaintOpBuffer : public SkRefCnt { |
enum { kInitialBufferSize = 4096 }; |
// It's not necessarily the case that the op with the maximum alignment |
// requirements is also the biggest op, but for now that's true. |
- static constexpr size_t PaintOpAlign = ALIGNOF(DrawDRRectOp); |
+ static constexpr size_t PaintOpAlign = alignof(DrawDRRectOp); |
PaintOpBuffer(); |
~PaintOpBuffer() override; |
@@ -819,7 +819,7 @@ class CC_PAINT_EXPORT PaintOpBuffer : public SkRefCnt { |
void ShrinkToFit(); |
PaintOp* GetFirstOp() const { |
- return const_cast<PaintOp*>(first_op_.data_as<PaintOp>()); |
+ return const_cast<PaintOp*>(reinterpret_cast<const PaintOp*>(&first_op_)); |
} |
template <typename T, typename... Args> |
@@ -931,7 +931,7 @@ class CC_PAINT_EXPORT PaintOpBuffer : public SkRefCnt { |
template <typename T, typename... Args> |
T* push_internal(size_t bytes, Args&&... args) { |
- static_assert(ALIGNOF(T) <= PaintOpAlign, ""); |
+ static_assert(alignof(T) <= PaintOpAlign, ""); |
auto pair = AllocatePaintOp(sizeof(T), bytes); |
T* op = reinterpret_cast<T*>(pair.first); |
@@ -957,7 +957,7 @@ class CC_PAINT_EXPORT PaintOpBuffer : public SkRefCnt { |
// As a performance optimization because n=1 is an extremely common case just |
// store the first op in the PaintOpBuffer itself to avoid an extra alloc. |
- base::AlignedMemory<sizeof(LargestPaintOp), PaintOpAlign> first_op_; |
+ std::aligned_storage<sizeof(LargestPaintOp), PaintOpAlign>::type first_op_; |
std::unique_ptr<char, base::AlignedFreeDeleter> data_; |
size_t used_ = 0; |
size_t reserved_ = 0; |