Delete unused path_utils.* component.

filter tool includes it but isn't using, and nobody else seems to
be using it either. So just remove it now.

BUG=None
TEST=make filter
R=mtklein@google.com

Author: tfarina@chromium.org

Review URL: https://codereview.chromium.org/324273002
This commit is contained in:
tfarina 2014-06-14 04:50:04 -07:00 committed by Commit bot
parent f252f64f17
commit 055cf91416
4 changed files with 0 additions and 184 deletions

View File

@ -526,8 +526,6 @@
],
'sources': [
'../tools/filtermain.cpp',
'../tools/path_utils.h',
'../tools/path_utils.cpp',
'../src/utils/debugger/SkDrawCommand.h',
'../src/utils/debugger/SkDrawCommand.cpp',
'../src/utils/debugger/SkDebugCanvas.h',

View File

@ -18,7 +18,6 @@
#include "SkPictureRecorder.h"
#include "SkStream.h"
#include "picture_utils.h"
#include "path_utils.h"
__SK_FORCE_IMAGE_DECODER_LINKING;

View File

@ -1,134 +0,0 @@
/*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "path_utils.h"
#include "SkPath.h"
#include "SkStream.h"
namespace sk_tools {
static int gCurPathID = 0;
void dump_path_prefix(SkFILEWStream* pathStream) {
if (NULL == pathStream) {
return;
}
pathStream->writeText("#include \"SkScalar.h\"\n");
pathStream->writeText("#include \"SkPoint.h\"\n");
pathStream->writeText("#include \"SkBitmap.h\"\n");
pathStream->writeText("#include \"SkDevice.h\"\n");
pathStream->writeText("#include \"SkString.h\"\n");
pathStream->writeText("#include \"SkImageEncoder.h\"\n");
}
void dump_path(SkFILEWStream* pathStream, const SkPath& path) {
if (NULL == pathStream) {
return;
}
static const int kMaxPts = 200;
static const int kMaxVerbs = 200;
int numPts = path.countPoints();
int numVerbs = path.countVerbs();
SkASSERT(numPts <= kMaxPts);
SkASSERT(numVerbs <= kMaxVerbs);
SkPoint pts[kMaxPts];
uint8_t verbs[kMaxVerbs];
path.getPoints(pts, kMaxPts);
path.getVerbs(verbs, kMaxVerbs);
const char* gStrs[] = {
"kMove_Verb",
"kLine_Verb",
"kQuad_Verb",
"kCubic_Verb",
"kClose_Verb",
"kDone_Verb"
};
pathStream->writeText("static const int numPts");
pathStream->writeDecAsText(gCurPathID);
pathStream->writeText(" = ");
pathStream->writeDecAsText(numPts);
pathStream->writeText(";\n");
pathStream->writeText("SkPoint pts");
pathStream->writeDecAsText(gCurPathID);
pathStream->writeText("[] = {\n");
for (int i = 0; i < numPts; ++i) {
SkString temp;
pathStream->writeText(" { ");
temp.appendScalar(pts[i].fX);
temp.append("f, ");
temp.appendScalar(pts[i].fY);
temp.append("f },\n");
pathStream->writeText(temp.c_str());
}
pathStream->writeText("};\n");
pathStream->writeText("static const int numVerbs");
pathStream->writeDecAsText(gCurPathID);
pathStream->writeText(" = ");
pathStream->writeDecAsText(numVerbs);
pathStream->writeText(";\n");
pathStream->writeText("uint8_t verbs");
pathStream->writeDecAsText(gCurPathID);
pathStream->writeText("[] = {\n");
for (int i = 0; i < numVerbs; ++i) {
pathStream->writeText("\tSkPath::");
pathStream->writeText(gStrs[verbs[i]]);
pathStream->writeText(",\n");
}
pathStream->writeText("};\n");
gCurPathID++;
}
void dump_path_suffix(SkFILEWStream* pathStream) {
if (NULL == pathStream) {
return;
}
pathStream->writeText("int numPaths = ");
pathStream->writeDecAsText(gCurPathID);
pathStream->writeText(";\n");
pathStream->writeText("int sizes[] = {\n");
for (int i = 0; i < gCurPathID; ++i) {
pathStream->writeText("\t numPts");
pathStream->writeDecAsText(i);
pathStream->writeText(", numVerbs");
pathStream->writeDecAsText(i);
pathStream->writeText(",\n");
}
pathStream->writeText("};\n");
pathStream->writeText("const SkPoint* points[] = {\n");
for (int i = 0; i < gCurPathID; ++i) {
pathStream->writeText("\tpts");
pathStream->writeDecAsText(i);
pathStream->writeText(",\n");
}
pathStream->writeText("};\n");
pathStream->writeText("const uint8_t* verbs[] = {\n");
for (int i = 0; i < gCurPathID; ++i) {
pathStream->writeText("\t(const uint8_t*)verbs");
pathStream->writeDecAsText(i);
pathStream->writeText(",\n");
}
pathStream->writeText("};\n");
}
}

View File

@ -1,47 +0,0 @@
/*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef path_utils_DEFINED
#define path_utils_DEFINED
class SkFILEWStream;
class SkPath;
namespace sk_tools {
// These utilities help write paths to a .cpp file in a compileable form.
// To use call them in the order:
// dump_path_prefix - once per program invocation
// dump_path - once for each path of interest
// dump_path_suffix - once per program invocation
//
// The output system relies on a global current path ID and assumes that
// only one set of aggregation arrays will be written per program
// invocation. These utilities are not thread safe.
// Write of the headers needed to compile the resulting .cpp file
void dump_path_prefix(SkFILEWStream* pathStream);
// Write out a single path in the form:
// static const int numPts# = ...;
// SkPoint pts#[] = { ... };
// static const int numVerbs# = ...;
// uint8_t verbs#[] = { ... };
// Where # is a globally unique identifier
void dump_path(SkFILEWStream* pathStream, const SkPath& path);
// Write out structures to aggregate info about the written paths:
// int numPaths = ...;
// int sizes[] = {
// numPts#, numVerbs#,
// ...
// };
// const SkPoint* points[] = { pts#, ... };
// const uint8_t* verbs[] = { verbs#, ... };
void dump_path_suffix(SkFILEWStream* pathStream);
}
#endif