aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/shaders/gradients
diff options
context:
space:
mode:
authorGravatar Yuqian Li <liyuqian@google.com>2018-01-09 11:51:48 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-09 20:14:37 +0000
commit98eb1694c580af4d254cfa758e4ce121d5e6c6bb (patch)
tree917d7f803fc6b6123dfb8a8832522888c8583801 /src/shaders/gradients
parent4d91e3091dda69b1d0d987761cf0358f8ae0f661 (diff)
Remove DumpHelper as the bug is fixed
Bug: skia:7436 Change-Id: I1dd09eb2b2d07f13b1ace01259791d8e0ce26ae8 Reviewed-on: https://skia-review.googlesource.com/92702 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
Diffstat (limited to 'src/shaders/gradients')
-rw-r--r--src/shaders/gradients/SkGradientShaderPriv.h2
-rw-r--r--src/shaders/gradients/SkTwoPointConicalGradient_gpu.cpp46
2 files changed, 0 insertions, 48 deletions
diff --git a/src/shaders/gradients/SkGradientShaderPriv.h b/src/shaders/gradients/SkGradientShaderPriv.h
index 919b451bd9..53411b2d17 100644
--- a/src/shaders/gradients/SkGradientShaderPriv.h
+++ b/src/shaders/gradients/SkGradientShaderPriv.h
@@ -339,8 +339,6 @@ private:
// gradients, and only changes behavior for gradients
// that don't use a texture.
- friend class DumpHelper; // to access RandomGradientParams
-
typedef GrFragmentProcessor INHERITED;
};
diff --git a/src/shaders/gradients/SkTwoPointConicalGradient_gpu.cpp b/src/shaders/gradients/SkTwoPointConicalGradient_gpu.cpp
index 6dc0675b24..b6f569de82 100644
--- a/src/shaders/gradients/SkTwoPointConicalGradient_gpu.cpp
+++ b/src/shaders/gradients/SkTwoPointConicalGradient_gpu.cpp
@@ -118,42 +118,6 @@ GR_DEFINE_FRAGMENT_PROCESSOR_TEST(TwoPointConicalEffect);
#if GR_TEST_UTILS
-// TODO (liyuqian): remove this and the friend declaration once the bug skia:7436 is fixed.
-class DumpHelper {
-public:
- static void Dump(GrGradientEffect::RandomGradientParams& params) {
- if (params.fColorSpace) {
- auto csData = params.fColorSpace->serialize();
- DumpData("csData", csData->data(), csData->size());
- SkDebugf("sk_sp<SkColorSpace> colorSpace = SkColorSpace::Deserialize(csData, %d);\n",
- csData->size());
- } else {
- SkDebugf("sk_sp<SkColorSpace> colorSpace = nullptr;");
- }
-
- auto csBackup = params.fColorSpace;
- params.fColorSpace = nullptr; // make sure that we won't dump an illegal sk_sp
- DumpData("paramsData", &params, sizeof(GrGradientEffect::RandomGradientParams));
- SkDebugf("auto& params = *(RandomGradientParams*)(paramsData);\n");
- SkDebugf("params.fColorSpace = colorSpace;\n");
- SkDebugf("if (params.fStops != nullptr) { params.fStops = params.fStopStorage; }\n");
- params.fColorSpace = csBackup;
- }
-
- static void DumpData(const char* name, const void* data, int size) {
- SkDebugf("char %s[%d] = {", name, size);
- for(int i = 0; i < size; ++i) {
- SkDebugf("%s%d", i == 0 ? "" : ", ", static_cast<const char*>(data)[i]);
- }
- SkDebugf("};\n");
- }
-
- static SkString Hex(float f) {
- return SkStringPrintf("SkBits2Float(0x%08x)", SkFloat2Bits(f));
- }
-};
-
-
std::unique_ptr<GrFragmentProcessor> TwoPointConicalEffect::TestCreate(
GrProcessorTestData* d) {
SkPoint center1 = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()};
@@ -223,16 +187,6 @@ std::unique_ptr<GrFragmentProcessor> TwoPointConicalEffect::TestCreate(
GrTest::TestAsFPArgs asFPArgs(d);
std::unique_ptr<GrFragmentProcessor> fp = as_SB(shader)->asFragmentProcessor(asFPArgs.args());
-#ifdef SK_DEBUG
- if (!fp) {
- auto h = DumpHelper::Hex;
- SkDebugf("SkPoint center1 = {%s, %s};\n", h(center1.fX).c_str(), h(center1.fY).c_str());
- SkDebugf("SkPoint center2 = {%s, %s};\n", h(center2.fX).c_str(), h(center2.fY).c_str());
- SkDebugf("SkScalar radius1 = %s, radius2 = %s;\n", h(radius1).c_str(), h(radius2).c_str());
- DumpHelper::Dump(params);
- }
-#endif
-
GrAlwaysAssert(fp);
return fp;
}