aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-03-08 10:39:02 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-08 19:44:43 +0000
commit90b200532730a25f1971e1bdeab67e86659d204a (patch)
tree08d3fb0c570aab372f241b922a9e0865be98f159
parentdcd2a908f424f080170a7d415ea0280d186e5d7f (diff)
remove SkPictureUtils.h
BUG=skia: Change-Id: Iab6e71f347fa34baf442e38ba7773058695f3e6d Reviewed-on: https://skia-review.googlesource.com/9348 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
-rw-r--r--bench/nanobench.cpp5
-rw-r--r--gn/utils.gni1
-rw-r--r--include/utils/SkPictureUtils.h28
-rw-r--r--src/core/SkPictureRecorder.cpp3
-rw-r--r--src/core/SkRecordedDrawable.cpp3
-rw-r--r--src/core/SkRecorder.cpp5
-rw-r--r--tests/PictureTest.cpp1
7 files changed, 6 insertions, 40 deletions
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index f73ae464cc..5e13a29671 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -40,7 +40,6 @@
#include "SkOSFile.h"
#include "SkOSPath.h"
#include "SkPictureRecorder.h"
-#include "SkPictureUtils.h"
#include "SkSVGDOM.h"
#include "SkScan.h"
#include "SkString.h"
@@ -714,7 +713,7 @@ public:
SkString name = SkOSPath::Basename(path.c_str());
fSourceType = "skp";
fBenchType = "recording";
- fSKPBytes = static_cast<double>(SkPictureUtils::ApproximateBytesUsed(pic.get()));
+ fSKPBytes = static_cast<double>(pic->approximateBytesUsed());
fSKPOps = pic->approximateOpCount();
return new RecordingBench(name.c_str(), pic.get(), FLAGS_bbh, FLAGS_lite);
}
@@ -729,7 +728,7 @@ public:
SkString name = SkOSPath::Basename(path.c_str());
fSourceType = "skp";
fBenchType = "piping";
- fSKPBytes = static_cast<double>(SkPictureUtils::ApproximateBytesUsed(pic.get()));
+ fSKPBytes = static_cast<double>(pic->approximateBytesUsed());
fSKPOps = pic->approximateOpCount();
return new PipingBench(name.c_str(), pic.get());
}
diff --git a/gn/utils.gni b/gn/utils.gni
index bf02b19eaf..4dd09e81a6 100644
--- a/gn/utils.gni
+++ b/gn/utils.gni
@@ -22,7 +22,6 @@ skia_utils_sources = [
"$_include/utils/SkPaintFilterCanvas.h",
"$_include/utils/SkParse.h",
"$_include/utils/SkParsePath.h",
- "$_include/utils/SkPictureUtils.h",
"$_include/utils/SkRandom.h",
"$_include/utils/SkShadowUtils.h",
"$_include/utils/SkTextBox.h",
diff --git a/include/utils/SkPictureUtils.h b/include/utils/SkPictureUtils.h
deleted file mode 100644
index b65a64d579..0000000000
--- a/include/utils/SkPictureUtils.h
+++ /dev/null
@@ -1,28 +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 SkPictureUtils_DEFINED
-#define SkPictureUtils_DEFINED
-
-#include "SkPicture.h"
-
-// TODO: remove this file?
-
-class SK_API SkPictureUtils {
-public:
- /**
- * How many bytes are allocated to hold the SkPicture.
- * Includes operations, parameters, bounding data, deletion listeners;
- * includes nested SkPictures, but does not include large objects that
- * SkRecord holds a reference to (e.g. paths, or pixels backing bitmaps).
- */
- static size_t ApproximateBytesUsed(const SkPicture* pict) {
- return pict->approximateBytesUsed();
- }
-};
-
-#endif
diff --git a/src/core/SkPictureRecorder.cpp b/src/core/SkPictureRecorder.cpp
index 758aa3e5ec..0c81632eb8 100644
--- a/src/core/SkPictureRecorder.cpp
+++ b/src/core/SkPictureRecorder.cpp
@@ -9,7 +9,6 @@
#include "SkData.h"
#include "SkDrawable.h"
#include "SkPictureRecorder.h"
-#include "SkPictureUtils.h"
#include "SkRecord.h"
#include "SkRecordDraw.h"
#include "SkRecordOpts.h"
@@ -89,7 +88,7 @@ sk_sp<SkPicture> SkPictureRecorder::finishRecordingAsPicture(uint32_t finishFlag
size_t subPictureBytes = fRecorder->approxBytesUsedBySubPictures();
for (int i = 0; pictList && i < pictList->count(); i++) {
- subPictureBytes += SkPictureUtils::ApproximateBytesUsed(pictList->begin()[i]);
+ subPictureBytes += pictList->begin()[i]->approximateBytesUsed();
}
return sk_make_sp<SkBigPicture>(fCullRect, fRecord.release(), pictList, fBBH.release(),
subPictureBytes);
diff --git a/src/core/SkRecordedDrawable.cpp b/src/core/SkRecordedDrawable.cpp
index d153762518..342701a365 100644
--- a/src/core/SkRecordedDrawable.cpp
+++ b/src/core/SkRecordedDrawable.cpp
@@ -10,7 +10,6 @@
#include "SkPicturePlayback.h"
#include "SkPictureRecord.h"
#include "SkPictureRecorder.h"
-#include "SkPictureUtils.h"
#include "SkRecordedDrawable.h"
#include "SkRecordDraw.h"
@@ -34,7 +33,7 @@ SkPicture* SkRecordedDrawable::onNewPictureSnapshot() {
size_t subPictureBytes = 0;
for (int i = 0; pictList && i < pictList->count(); i++) {
- subPictureBytes += SkPictureUtils::ApproximateBytesUsed(pictList->begin()[i]);
+ subPictureBytes += pictList->begin()[i]->approximateBytesUsed();
}
// SkBigPicture will take ownership of a ref on both fRecord and fBBH.
// We're not willing to give up our ownership, so we must ref them for SkPicture.
diff --git a/src/core/SkRecorder.cpp b/src/core/SkRecorder.cpp
index 2f0f8369ee..fb0bda7e0b 100644
--- a/src/core/SkRecorder.cpp
+++ b/src/core/SkRecorder.cpp
@@ -10,7 +10,6 @@
#include "SkImage.h"
#include "SkPatchUtils.h"
#include "SkPicture.h"
-#include "SkPictureUtils.h"
#include "SkRecorder.h"
#include "SkSurface.h"
@@ -301,7 +300,7 @@ void SkRecorder::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
void SkRecorder::onDrawPicture(const SkPicture* pic, const SkMatrix* matrix, const SkPaint* paint) {
if (fDrawPictureMode == Record_DrawPictureMode) {
- fApproxBytesUsedBySubPictures += SkPictureUtils::ApproximateBytesUsed(pic);
+ fApproxBytesUsedBySubPictures += pic->approximateBytesUsed();
APPEND(DrawPicture, this->copy(paint), sk_ref_sp(pic), matrix ? *matrix : SkMatrix::I());
} else {
SkASSERT(fDrawPictureMode == Playback_DrawPictureMode);
@@ -313,7 +312,7 @@ void SkRecorder::onDrawPicture(const SkPicture* pic, const SkMatrix* matrix, con
void SkRecorder::onDrawShadowedPicture(const SkPicture* pic, const SkMatrix* matrix,
const SkPaint* paint, const SkShadowParams& params) {
if (fDrawPictureMode == Record_DrawPictureMode) {
- fApproxBytesUsedBySubPictures += SkPictureUtils::ApproximateBytesUsed(pic);
+ fApproxBytesUsedBySubPictures += pic->approximateBytesUsed();
APPEND(DrawShadowedPicture, this->copy(paint),
sk_ref_sp(pic),
matrix ? *matrix : SkMatrix::I(),
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index 636b62c14a..0b929d60e1 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -21,7 +21,6 @@
#include "SkPicture.h"
#include "SkPictureAnalyzer.h"
#include "SkPictureRecorder.h"
-#include "SkPictureUtils.h"
#include "SkPixelRef.h"
#include "SkPixelSerializer.h"
#include "SkMiniRecorder.h"