aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2017-05-24 15:33:28 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-24 19:56:15 +0000
commit58a756435ca3700d9766a4580bb0771a9774f603 (patch)
tree698e327baf54c7c449d019b95f51a553fbadc59c /tests
parentaa13223f54d1f55ba702582f61359f8b43782730 (diff)
SkShaderBase
Introduce a private base class (SkShaderBase), to hide implementation details from the public interface (SkShader). Change-Id: If3ec26ca6abc9da20e3f139c11fdc023bdd85176 Reviewed-on: https://skia-review.googlesource.com/17241 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Reed <reed@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/SerializationTest.cpp9
-rw-r--r--tests/TessellatingPathRendererTests.cpp5
2 files changed, 8 insertions, 6 deletions
diff --git a/tests/SerializationTest.cpp b/tests/SerializationTest.cpp
index bb49df0528..1212833c0e 100644
--- a/tests/SerializationTest.cpp
+++ b/tests/SerializationTest.cpp
@@ -18,6 +18,7 @@
#include "SkNormalSource.h"
#include "SkOSFile.h"
#include "SkPictureRecorder.h"
+#include "SkShaderBase.h"
#include "SkTableColorFilter.h"
#include "SkTemplates.h"
#include "SkTypeface.h"
@@ -610,22 +611,22 @@ DEF_TEST(Serialization, reporter) {
sk_sp<SkShader> lightingShader = SkLightingShader::Make(diffuseShader,
normalSource,
fLights);
- sk_sp<SkShader>(TestFlattenableSerialization(lightingShader.get(), true, reporter));
+ sk_sp<SkShader>(TestFlattenableSerialization(as_SB(lightingShader.get()), true, reporter));
lightingShader = SkLightingShader::Make(std::move(diffuseShader),
nullptr,
fLights);
- sk_sp<SkShader>(TestFlattenableSerialization(lightingShader.get(), true, reporter));
+ sk_sp<SkShader>(TestFlattenableSerialization(as_SB(lightingShader.get()), true, reporter));
lightingShader = SkLightingShader::Make(nullptr,
std::move(normalSource),
fLights);
- sk_sp<SkShader>(TestFlattenableSerialization(lightingShader.get(), true, reporter));
+ sk_sp<SkShader>(TestFlattenableSerialization(as_SB(lightingShader.get()), true, reporter));
lightingShader = SkLightingShader::Make(nullptr,
nullptr,
fLights);
- sk_sp<SkShader>(TestFlattenableSerialization(lightingShader.get(), true, reporter));
+ sk_sp<SkShader>(TestFlattenableSerialization(as_SB(lightingShader.get()), true, reporter));
}
// Test NormalBevelSource serialization
diff --git a/tests/TessellatingPathRendererTests.cpp b/tests/TessellatingPathRendererTests.cpp
index 79385af956..f799bd7e91 100644
--- a/tests/TessellatingPathRendererTests.cpp
+++ b/tests/TessellatingPathRendererTests.cpp
@@ -13,6 +13,7 @@
#include "GrClip.h"
#include "GrContext.h"
#include "SkGradientShader.h"
+#include "SkShaderBase.h"
#include "ops/GrTessellatingPathRenderer.h"
/*
@@ -279,9 +280,9 @@ static sk_sp<GrFragmentProcessor> create_linear_gradient_processor(GrContext* ct
SkColor colors[2] = { SK_ColorGREEN, SK_ColorBLUE };
sk_sp<SkShader> shader = SkGradientShader::MakeLinear(
pts, colors, nullptr, SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode);
- SkShader::AsFPArgs args(
+ SkShaderBase::AsFPArgs args(
ctx, &SkMatrix::I(), &SkMatrix::I(), SkFilterQuality::kLow_SkFilterQuality, nullptr);
- return shader->asFragmentProcessor(args);
+ return as_SB(shader)->asFragmentProcessor(args);
}
static void test_path(GrContext* ctx,