aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2016-03-03 14:23:47 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-03 14:23:47 -0800
commite38bcaf24b00066e167e03a5ac63cf828914d747 (patch)
tree88b3764be24dbf59e7a6e3d88beeb66f12c64dda /src/effects
parentce56026db55d8585c2f920a6107a25b40fd5160a (diff)
Revert of enforce 16byte alignment in shader contexts (patchset #1 id:1 of https://codereview.chromium.org/1759653004/ )
Reason for revert: Test-Win8-MSVC-ShuttleB-CPU-AVX2-x86-Debug failed dm: .... FYI: loaded 23439 distinct uninteresting hashes from 23439 lines Skipping config gpu: Don't understand 'gpu'. Skipping config msaa16: Don't understand 'msaa16'. 168400 srcs * 7 sinks + 481 tests == 1179281 tasks 0ns elapsed, 5 active, 1179276 queued, 55MB RAM, 55MB peak 565 gm xfermodes2 565 gm xfermodes 565 gm xfermodeimagefilter 565 gm xfermodes3 565 gm verylarge_picture_image c:\0\build\slave\workdir\build\skia\src\core\skshader.cpp:108: fatal error: ""(0 == ((size) & 15))"" step returned non-zero exit code: 3 @@@STEP_FAILURE@@@ Original issue's description: > enforce 16byte alignment in shader contexts > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1759653004 > > Committed: https://skia.googlesource.com/skia/+/d812fb458807245daa812adb7af0733cf5b54d96 TBR=mtklein@google.com,fmalita@chromium.org,herb@google.com,reed@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1759323002
Diffstat (limited to 'src/effects')
-rw-r--r--src/effects/SkPerlinNoiseShader.cpp4
-rw-r--r--src/effects/gradients/SkLinearGradient.cpp6
-rw-r--r--src/effects/gradients/SkLinearGradient.h3
-rw-r--r--src/effects/gradients/SkRadialGradient.cpp4
-rw-r--r--src/effects/gradients/SkRadialGradient.h3
-rw-r--r--src/effects/gradients/SkSweepGradient.cpp4
-rw-r--r--src/effects/gradients/SkSweepGradient.h3
-rw-r--r--src/effects/gradients/SkTwoPointConicalGradient.cpp4
-rw-r--r--src/effects/gradients/SkTwoPointConicalGradient.h4
9 files changed, 20 insertions, 15 deletions
diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp
index a32d8ac2bb..ed7340ca3a 100644
--- a/src/effects/SkPerlinNoiseShader.cpp
+++ b/src/effects/SkPerlinNoiseShader.cpp
@@ -434,8 +434,8 @@ SkShader::Context* SkPerlinNoiseShader::onCreateContext(const ContextRec& rec,
return new (storage) PerlinNoiseShaderContext(*this, rec);
}
-size_t SkPerlinNoiseShader::onContextSize(const ContextRec&) const {
- return SkAlign16(sizeof(PerlinNoiseShaderContext));
+size_t SkPerlinNoiseShader::contextSize(const ContextRec&) const {
+ return sizeof(PerlinNoiseShaderContext);
}
SkPerlinNoiseShader::PerlinNoiseShaderContext::PerlinNoiseShaderContext(
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp
index 40503c96f1..cc8875cf8e 100644
--- a/src/effects/gradients/SkLinearGradient.cpp
+++ b/src/effects/gradients/SkLinearGradient.cpp
@@ -88,10 +88,10 @@ void SkLinearGradient::flatten(SkWriteBuffer& buffer) const {
buffer.writePoint(fEnd);
}
-size_t SkLinearGradient::onContextSize(const ContextRec& rec) const {
+size_t SkLinearGradient::contextSize(const ContextRec& rec) const {
return use_4f_context(rec, fGradFlags)
- ? SkAlign16(sizeof(LinearGradient4fContext))
- : SkAlign16(sizeof(LinearGradientContext));
+ ? sizeof(LinearGradient4fContext)
+ : sizeof(LinearGradientContext);
}
SkShader::Context* SkLinearGradient::onCreateContext(const ContextRec& rec, void* storage) const {
diff --git a/src/effects/gradients/SkLinearGradient.h b/src/effects/gradients/SkLinearGradient.h
index f0ce49b8b3..33ddfc2f9e 100644
--- a/src/effects/gradients/SkLinearGradient.h
+++ b/src/effects/gradients/SkLinearGradient.h
@@ -33,6 +33,8 @@ public:
SkLinearGradient(const SkPoint pts[2], const Descriptor&);
+ size_t contextSize(const ContextRec&) const override;
+
class LinearGradientContext : public SkGradientShaderBase::GradientShaderBaseContext {
public:
LinearGradientContext(const SkLinearGradient&, const ContextRec&);
@@ -69,7 +71,6 @@ public:
protected:
SkLinearGradient(SkReadBuffer& buffer);
void flatten(SkWriteBuffer& buffer) const override;
- size_t onContextSize(const ContextRec&) const override;
Context* onCreateContext(const ContextRec&, void* storage) const override;
private:
diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp
index da4c6f2412..466ae045a5 100644
--- a/src/effects/gradients/SkRadialGradient.cpp
+++ b/src/effects/gradients/SkRadialGradient.cpp
@@ -40,8 +40,8 @@ SkRadialGradient::SkRadialGradient(const SkPoint& center, SkScalar radius, const
, fRadius(radius) {
}
-size_t SkRadialGradient::onContextSize(const ContextRec&) const {
- return SkAlign16(sizeof(RadialGradientContext));
+size_t SkRadialGradient::contextSize(const ContextRec&) const {
+ return sizeof(RadialGradientContext);
}
SkShader::Context* SkRadialGradient::onCreateContext(const ContextRec& rec, void* storage) const {
diff --git a/src/effects/gradients/SkRadialGradient.h b/src/effects/gradients/SkRadialGradient.h
index 428d7fae79..9d98f18304 100644
--- a/src/effects/gradients/SkRadialGradient.h
+++ b/src/effects/gradients/SkRadialGradient.h
@@ -15,6 +15,8 @@ class SkRadialGradient : public SkGradientShaderBase {
public:
SkRadialGradient(const SkPoint& center, SkScalar radius, const Descriptor&);
+ size_t contextSize(const ContextRec&) const override;
+
class RadialGradientContext : public SkGradientShaderBase::GradientShaderBaseContext {
public:
RadialGradientContext(const SkRadialGradient&, const ContextRec&);
@@ -39,7 +41,6 @@ public:
protected:
SkRadialGradient(SkReadBuffer& buffer);
void flatten(SkWriteBuffer& buffer) const override;
- size_t onContextSize(const ContextRec&) const override;
Context* onCreateContext(const ContextRec&, void* storage) const override;
private:
diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp
index 12d55e8b49..de80c79ae0 100644
--- a/src/effects/gradients/SkSweepGradient.cpp
+++ b/src/effects/gradients/SkSweepGradient.cpp
@@ -45,8 +45,8 @@ void SkSweepGradient::flatten(SkWriteBuffer& buffer) const {
buffer.writePoint(fCenter);
}
-size_t SkSweepGradient::onContextSize(const ContextRec&) const {
- return SkAlign16(sizeof(SweepGradientContext));
+size_t SkSweepGradient::contextSize(const ContextRec&) const {
+ return sizeof(SweepGradientContext);
}
SkShader::Context* SkSweepGradient::onCreateContext(const ContextRec& rec, void* storage) const {
diff --git a/src/effects/gradients/SkSweepGradient.h b/src/effects/gradients/SkSweepGradient.h
index f458cea8ce..ec6df45c64 100644
--- a/src/effects/gradients/SkSweepGradient.h
+++ b/src/effects/gradients/SkSweepGradient.h
@@ -15,6 +15,8 @@ class SkSweepGradient : public SkGradientShaderBase {
public:
SkSweepGradient(SkScalar cx, SkScalar cy, const Descriptor&);
+ size_t contextSize(const ContextRec&) const override;
+
class SweepGradientContext : public SkGradientShaderBase::GradientShaderBaseContext {
public:
SweepGradientContext(const SkSweepGradient& shader, const ContextRec&);
@@ -39,7 +41,6 @@ public:
protected:
void flatten(SkWriteBuffer& buffer) const override;
- size_t onContextSize(const ContextRec&) const override;
Context* onCreateContext(const ContextRec&, void* storage) const override;
private:
diff --git a/src/effects/gradients/SkTwoPointConicalGradient.cpp b/src/effects/gradients/SkTwoPointConicalGradient.cpp
index f4b6b0c8b0..2209306fe3 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient.cpp
@@ -211,8 +211,8 @@ bool SkTwoPointConicalGradient::isOpaque() const {
return false;
}
-size_t SkTwoPointConicalGradient::onContextSize(const ContextRec&) const {
- return SkAlign16(sizeof(TwoPointConicalGradientContext));
+size_t SkTwoPointConicalGradient::contextSize(const ContextRec&) const {
+ return sizeof(TwoPointConicalGradientContext);
}
SkShader::Context* SkTwoPointConicalGradient::onCreateContext(const ContextRec& rec,
diff --git a/src/effects/gradients/SkTwoPointConicalGradient.h b/src/effects/gradients/SkTwoPointConicalGradient.h
index 5783c39bd4..954b09698e 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient.h
+++ b/src/effects/gradients/SkTwoPointConicalGradient.h
@@ -45,6 +45,9 @@ public:
const SkPoint& end, SkScalar endRadius,
bool flippedGrad, const Descriptor&);
+
+ size_t contextSize(const ContextRec&) const override;
+
class TwoPointConicalGradientContext : public SkGradientShaderBase::GradientShaderBaseContext {
public:
TwoPointConicalGradientContext(const SkTwoPointConicalGradient&, const ContextRec&);
@@ -79,7 +82,6 @@ public:
protected:
SkTwoPointConicalGradient(SkReadBuffer& buffer);
void flatten(SkWriteBuffer& buffer) const override;
- size_t onContextSize(const ContextRec&) const override;
Context* onCreateContext(const ContextRec&, void* storage) const override;
private: