chromium/third_party/skia/src/pdf/SkPDFDocument.cpp

/*
 * Copyright 2011 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "include/docs/SkPDFDocument.h"

#include "include/core/SkCanvas.h"
#include "include/core/SkData.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkRect.h"
#include "include/core/SkSize.h"
#include "include/core/SkStream.h"
#include "include/core/SkTypes.h"
#include "include/private/base/SkMutex.h"
#include "include/private/base/SkPoint_impl.h"
#include "include/private/base/SkSemaphore.h"
#include "include/private/base/SkSpan_impl.h"
#include "include/private/base/SkTemplates.h"
#include "include/private/base/SkThreadAnnotations.h"
#include "include/private/base/SkTo.h"
#include "src/base/SkUTF.h"
#include "src/core/SkAdvancedTypefaceMetrics.h"
#include "src/core/SkTHash.h"
#include "src/pdf/SkBitmapKey.h"
#include "src/pdf/SkPDFBitmap.h"
#include "src/pdf/SkPDFDevice.h"
#include "src/pdf/SkPDFDocumentPriv.h"
#include "src/pdf/SkPDFFont.h"
#include "src/pdf/SkPDFGradientShader.h"
#include "src/pdf/SkPDFGraphicState.h"
#include "src/pdf/SkPDFMetadata.h"
#include "src/pdf/SkPDFShader.h"
#include "src/pdf/SkPDFTag.h"
#include "src/pdf/SkPDFTypes.h"
#include "src/pdf/SkPDFUtils.h"
#include "src/pdf/SkUUID.h"

#include <algorithm>
#include <atomic>
#include <cstddef>
#include <new>
#include <utility>

// For use in SkCanvas::drawAnnotation
const char* SkPDFGetNodeIdKey() {}

static SkString ToValidUtf8String(const SkData& d) {}

////////////////////////////////////////////////////////////////////////////////

void SkPDFOffsetMap::markStartOfDocument(const SkWStream* s) {}

static size_t difference(size_t minuend, size_t subtrahend) {}

void SkPDFOffsetMap::markStartOfObject(int referenceNumber, const SkWStream* s) {}

int SkPDFOffsetMap::objectCount() const {}

int SkPDFOffsetMap::emitCrossReferenceTable(SkWStream* s) const {}
//
////////////////////////////////////////////////////////////////////////////////

#define SKPDF_MAGIC
#ifndef SK_BUILD_FOR_WIN
static_assert;
static_assert;
static_assert;
static_assert;
#endif
static void serializeHeader(SkPDFOffsetMap* offsetMap, SkWStream* wStream) {}
#undef SKPDF_MAGIC

static void begin_indirect_object(SkPDFOffsetMap* offsetMap,
                                  SkPDFIndirectReference ref,
                                  SkWStream* s) {}

static void end_indirect_object(SkWStream* s) {}

// Xref table and footer
static void serialize_footer(const SkPDFOffsetMap& offsetMap,
                             SkWStream* wStream,
                             SkPDFIndirectReference infoDict,
                             SkPDFIndirectReference docCatalog,
                             SkUUID uuid) {}

static SkPDFIndirectReference generate_page_tree(
        SkPDFDocument* doc,
        std::vector<std::unique_ptr<SkPDFDict>> pages,
        const std::vector<SkPDFIndirectReference>& pageRefs) {}

template<typename T, typename... Args>
static void reset_object(T* dst, Args&&... args) {}

////////////////////////////////////////////////////////////////////////////////

SkPDFDocument::SkPDFDocument(SkWStream* stream,
                             SkPDF::Metadata metadata)
    :{}

SkPDFDocument::~SkPDFDocument() {}

SkPDFIndirectReference SkPDFDocument::emit(const SkPDFObject& object, SkPDFIndirectReference ref){}

SkWStream* SkPDFDocument::beginObject(SkPDFIndirectReference ref) SK_REQUIRES(fMutex) {}

void SkPDFDocument::endObject() SK_REQUIRES(fMutex) {}

static SkSize operator*(SkISize u, SkScalar s) {}
static SkSize operator*(SkSize u, SkScalar s) {}

SkCanvas* SkPDFDocument::onBeginPage(SkScalar width, SkScalar height) {}

static void populate_link_annotation(SkPDFDict* annotation, const SkRect& r) {}

static SkPDFIndirectReference append_destinations(
        SkPDFDocument* doc,
        const std::vector<SkPDFNamedDestination>& namedDestinations)
{}

std::unique_ptr<SkPDFArray> SkPDFDocument::getAnnotations() {}

void SkPDFDocument::onEndPage() {}

void SkPDFDocument::onAbort() {}

static sk_sp<SkData> SkSrgbIcm() {}

static SkPDFIndirectReference make_srgb_color_profile(SkPDFDocument* doc) {}

static std::unique_ptr<SkPDFArray> make_srgb_output_intents(SkPDFDocument* doc) {}

SkPDFIndirectReference SkPDFDocument::getPage(size_t pageIndex) const {}

const SkMatrix& SkPDFDocument::currentPageTransform() const {}

SkPDFTagTree::Mark SkPDFDocument::createMarkIdForNodeId(int nodeId, SkPoint p) {}

void SkPDFDocument::addNodeTitle(int nodeId, SkSpan<const char> title) {}

int SkPDFDocument::createStructParentKeyForNodeId(int nodeId) {}

static std::vector<const SkPDFFont*> get_fonts(const SkPDFDocument& canon) {}

SkString SkPDFDocument::nextFontSubsetTag() {}

void SkPDFDocument::onClose(SkWStream* stream) {}

void SkPDFDocument::incrementJobCount() {}

void SkPDFDocument::signalJobComplete() {}

void SkPDFDocument::waitForJobs() {}

///////////////////////////////////////////////////////////////////////////////

void SkPDF::SetNodeId(SkCanvas* canvas, int nodeID) {}

sk_sp<SkDocument> SkPDF::MakeDocument(SkWStream* stream, const SkPDF::Metadata& metadata) {}

///////////////////////////////////////////////////////////////////////////////
void SkPDF::DateTime::toISO8601(SkString* dst) const {}