aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Jim Van Verth <jvanverth@google.com>2017-05-02 16:49:24 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-02 21:17:01 +0000
commit343fe49b82d5b220d64c64f253bb362026006632 (patch)
treee20dbd15a38ee573b2b90f1e8d955d4a46c4a5ee /tools
parent5e550ab57e0204bfadd2cb69c47d2a85e38d6a4c (diff)
Remove translateZ and lights from SkCanvas
Bug: skia:6557 Change-Id: I0dbf70c4131ab59e7fc6c674a6587767af98e13a Reviewed-on: https://skia-review.googlesource.com/15151 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/debugger/SkDebugCanvas.cpp7
-rw-r--r--tools/debugger/SkDebugCanvas.h6
-rw-r--r--tools/debugger/SkDrawCommand.cpp41
-rw-r--r--tools/debugger/SkDrawCommand.h16
4 files changed, 1 insertions, 69 deletions
diff --git a/tools/debugger/SkDebugCanvas.cpp b/tools/debugger/SkDebugCanvas.cpp
index bed6da03cf..23f4ae3f21 100644
--- a/tools/debugger/SkDebugCanvas.cpp
+++ b/tools/debugger/SkDebugCanvas.cpp
@@ -621,13 +621,6 @@ void SkDebugCanvas::didSetMatrix(const SkMatrix& matrix) {
this->INHERITED::didSetMatrix(matrix);
}
-void SkDebugCanvas::didTranslateZ(SkScalar z) {
-#ifdef SK_EXPERIMENTAL_SHADOWING
- this->addDrawCommand(new SkTranslateZCommand(z));
- this->INHERITED::didTranslateZ(z);
-#endif
-}
-
void SkDebugCanvas::toggleCommand(int index, bool toggle) {
SkASSERT(index < fCommandVector.count());
fCommandVector[index]->setVisible(toggle);
diff --git a/tools/debugger/SkDebugCanvas.h b/tools/debugger/SkDebugCanvas.h
index 6eb3456dff..9b944f7d5d 100644
--- a/tools/debugger/SkDebugCanvas.h
+++ b/tools/debugger/SkDebugCanvas.h
@@ -195,12 +195,6 @@ protected:
void didSetMatrix(const SkMatrix &) override;
-#ifdef SK_EXPERIMENTAL_SHADOWING
- void didTranslateZ(SkScalar) override;
-#else
- void didTranslateZ(SkScalar);
-#endif
-
void onDrawAnnotation(const SkRect&, const char[], SkData*) override;
void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) override;
void onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
diff --git a/tools/debugger/SkDrawCommand.cpp b/tools/debugger/SkDrawCommand.cpp
index 6029f83018..16a270b037 100644
--- a/tools/debugger/SkDrawCommand.cpp
+++ b/tools/debugger/SkDrawCommand.cpp
@@ -237,7 +237,6 @@ const char* SkDrawCommand::GetCommandString(OpType type) {
case kSave_OpType: return "Save";
case kSaveLayer_OpType: return "SaveLayer";
case kSetMatrix_OpType: return "SetMatrix";
- case kTranslateZ_OpType: return "TranslateZ";
default:
SkDebugf("OpType error 0x%08x\n", type);
SkASSERT(0);
@@ -295,9 +294,6 @@ SkDrawCommand* SkDrawCommand::fromJSON(Json::Value& command, UrlDataManager& url
INSTALL_FACTORY(Save);
INSTALL_FACTORY(SaveLayer);
INSTALL_FACTORY(SetMatrix);
-#ifdef SK_EXPERIMENTAL_SHADOWING
- INSTALL_FACTORY(TranslateZ);
-#endif
}
SkString name = SkString(command[SKDEBUGCANVAS_ATTRIBUTE_COMMAND].asCString());
FROM_JSON* factory = factories.find(name);
@@ -1570,14 +1566,6 @@ static void extract_json_matrix(Json::Value& matrix, SkMatrix* result) {
result->set9(values);
}
-#ifdef SK_EXPERIMENTAL_SHADOWING
-// somehow this is only used in shadows...
-static void extract_json_scalar(Json::Value& scalar, SkScalar* result) {
- SkScalar value = scalar.asFloat();
- *result = value;
-}
-#endif
-
static void extract_json_path(Json::Value& path, SkPath* result) {
const char* fillType = path[SKDEBUGCANVAS_ATTRIBUTE_FILLTYPE].asCString();
if (!strcmp(fillType, SKDEBUGCANVAS_FILLTYPE_WINDING)) {
@@ -3469,32 +3457,3 @@ SkSetMatrixCommand* SkSetMatrixCommand::fromJSON(Json::Value& command,
extract_json_matrix(command[SKDEBUGCANVAS_ATTRIBUTE_MATRIX], &matrix);
return new SkSetMatrixCommand(matrix);
}
-
-SkTranslateZCommand::SkTranslateZCommand(SkScalar z)
- : INHERITED(kTranslateZ_OpType) {
- fZTranslate = z;
- fInfo.push(SkObjectParser::ScalarToString(fZTranslate, "drawDepthTranslation"));
-}
-
-void SkTranslateZCommand::execute(SkCanvas* canvas) const {
-#ifdef SK_EXPERIMENTAL_SHADOWING
- canvas->translateZ(fZTranslate);
-#endif
-}
-
-Json::Value SkTranslateZCommand::toJSON(UrlDataManager& urlDataManager) const {
- Json::Value result = INHERITED::toJSON(urlDataManager);
- result[SKDEBUGCANVAS_ATTRIBUTE_DRAWDEPTHTRANS] = MakeJsonScalar(fZTranslate);
- return result;
-}
-
-SkTranslateZCommand* SkTranslateZCommand::fromJSON(Json::Value& command,
- UrlDataManager& urlDataManager) {
- SkScalar z;
-#ifdef SK_EXPERIMENTAL_SHADOWING
- extract_json_scalar(command[SKDEBUGCANVAS_ATTRIBUTE_DRAWDEPTHTRANS], &z);
-#else
- z = 0;
-#endif
- return new SkTranslateZCommand(z);
-}
diff --git a/tools/debugger/SkDrawCommand.h b/tools/debugger/SkDrawCommand.h
index ff64dd5d9f..fc2f45adef 100644
--- a/tools/debugger/SkDrawCommand.h
+++ b/tools/debugger/SkDrawCommand.h
@@ -57,9 +57,8 @@ public:
kSave_OpType,
kSaveLayer_OpType,
kSetMatrix_OpType,
- kTranslateZ_OpType,
- kLast_OpType = kTranslateZ_OpType
+ kLast_OpType = kSetMatrix_OpType
};
static const int kOpTypeCount = kLast_OpType + 1;
@@ -761,18 +760,5 @@ private:
typedef SkDrawCommand INHERITED;
};
-
-class SkTranslateZCommand : public SkDrawCommand {
-public:
- SkTranslateZCommand(SkScalar);
- void execute(SkCanvas* canvas) const override;
- Json::Value toJSON(UrlDataManager& urlDataManager) const override;
- static SkTranslateZCommand* fromJSON(Json::Value& command, UrlDataManager& urlDataManager);
-
-private:
- SkScalar fZTranslate;
-
- typedef SkDrawCommand INHERITED;
-};
#endif