aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkPDFCanon.cpp
diff options
context:
space:
mode:
authorGravatar Hal Canary <halcanary@google.com>2017-06-28 16:04:20 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-30 16:47:14 +0000
commit80fa7cea93974b0480f35f7a5260ce78ba50420f (patch)
treeefd0f86808985a700b386d94482724538f4f9fba /src/pdf/SkPDFCanon.cpp
parenta062258e76e28ef0ec88ef827ae84a90730393cc (diff)
SkPDF: simplify SkPDFGraphicState
- Separate graphic state objects for Stroke and Fill. - SkPDFGraphicState::GetGraphicStateForPaint simplified. - No more SkPDFGraphicState objects.Simplify SkPDFCanon. All PDFs render the same. Most PDFs are slightly smaller, especially those from captured web pages. Change-Id: Id9605c1d7495645da558d5f378ba585cdc201bba Reviewed-on: https://skia-review.googlesource.com/21343 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'src/pdf/SkPDFCanon.cpp')
-rw-r--r--src/pdf/SkPDFCanon.cpp20
1 files changed, 1 insertions, 19 deletions
diff --git a/src/pdf/SkPDFCanon.cpp b/src/pdf/SkPDFCanon.cpp
index 5e8a2cb0c2..3ecd474069 100644
--- a/src/pdf/SkPDFCanon.cpp
+++ b/src/pdf/SkPDFCanon.cpp
@@ -12,9 +12,7 @@
////////////////////////////////////////////////////////////////////////////////
-SkPDFCanon::~SkPDFCanon() {
- fGraphicStateRecords.foreach ([](WrapGS w) { w.fPtr->unref(); });
-}
+SkPDFCanon::~SkPDFCanon() {}
////////////////////////////////////////////////////////////////////////////////
@@ -56,19 +54,3 @@ void SkPDFCanon::addImageShader(sk_sp<SkPDFObject> pdfShader,
SkPDFShader::State state) {
fImageShaderRecords.emplace_back(ShaderRec{std::move(state), std::move(pdfShader)});
}
-
-////////////////////////////////////////////////////////////////////////////////
-
-const SkPDFGraphicState* SkPDFCanon::findGraphicState(
- const SkPDFGraphicState& key) const {
- const WrapGS* ptr = fGraphicStateRecords.find(WrapGS(&key));
- return ptr ? ptr->fPtr : nullptr;
-}
-
-void SkPDFCanon::addGraphicState(const SkPDFGraphicState* state) {
- SkASSERT(state);
- WrapGS w(SkRef(state));
- SkASSERT(!fGraphicStateRecords.contains(w));
- fGraphicStateRecords.add(w);
-}
-