Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Unified Diff: cc/paint/paint_op_buffer.h

Issue 2932053002: Use C++11 alignment primitives (Closed)
Patch Set: Fix merge Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/output/renderer_pixeltest.cc ('k') | cc/paint/paint_op_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/paint/paint_op_buffer.h
diff --git a/cc/paint/paint_op_buffer.h b/cc/paint/paint_op_buffer.h
index a5e04be1a4fda26f28ef61faf20eb338591407bb..ae40cad4c6212b86e260fcecec7bb163d63ef121 100644
--- a/cc/paint/paint_op_buffer.h
+++ b/cc/paint/paint_op_buffer.h
@@ -211,10 +211,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);
}
@@ -778,7 +778,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;
@@ -935,7 +935,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);
« no previous file with comments | « cc/output/renderer_pixeltest.cc ('k') | cc/paint/paint_op_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698