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

Unified Diff: src/core/SkLinearBitmapPipeline.h

Issue 2473143002: Use alignas to force alignment. (Closed)
Patch Set: Remove comment. Created 4 years, 1 month 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 | « include/core/SkPostConfig.h ('k') | src/core/SkSmallAllocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkLinearBitmapPipeline.h
diff --git a/src/core/SkLinearBitmapPipeline.h b/src/core/SkLinearBitmapPipeline.h
index 91b573df5d8c5a95de93ff3b31a5c82741633c57..3abdb8014aa134503d7694c7c9ba25705572d42e 100644
--- a/src/core/SkLinearBitmapPipeline.h
+++ b/src/core/SkLinearBitmapPipeline.h
@@ -78,17 +78,14 @@ public:
// the pipeline on a new sampler.
Base* cloneStageTo(Next* next, Stage* cloneToStage) const;
- Base* get() const { return reinterpret_cast<Base*>(&fSpace); }
+ Base* get() const { return reinterpret_cast<Base*>(fSpace); }
Base* operator->() const { return this->get(); }
Base& operator*() const { return *(this->get()); }
private:
std::function<void (Next*, void*)> fStageCloner;
- struct SK_STRUCT_ALIGN(16) Space {
- char space[kSize];
- };
- bool fIsInitialized;
- mutable Space fSpace;
+ alignas(16) mutable char fSpace[kSize];
+ bool fIsInitialized;
};
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -111,16 +108,13 @@ public:
fIsInitialized = true;
}
- Base* get() const { return reinterpret_cast<Base*>(&fSpace); }
+ Base* get() const { return reinterpret_cast<Base*>(fSpace); }
Base* operator->() const { return this->get(); }
Base& operator*() const { return *(this->get()); }
private:
- struct SK_STRUCT_ALIGN(16) Space {
- char space[kSize];
- };
- mutable Space fSpace;
- bool fIsInitialized;
+ alignas(16) mutable char fSpace[kSize];
+ bool fIsInitialized;
};
@@ -134,7 +128,7 @@ public:
using MatrixStage = Stage<PointProcessorInterface, 160, PointProcessorInterface>;
using TileStage = Stage<PointProcessorInterface, 160, SampleProcessorInterface>;
using SampleStage = Stage<SampleProcessorInterface, 160, BlendProcessorInterface>;
- using BlenderStage = Stage<BlendProcessorInterface, 40>;
+ using BlenderStage = Stage<BlendProcessorInterface, 48>;
using Accessor = PolyMemory<PixelAccessorInterface, 64>;
private:
« no previous file with comments | « include/core/SkPostConfig.h ('k') | src/core/SkSmallAllocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698