chromium/third_party/skia/src/core/SkPictureRecord.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 "src/core/SkPictureRecord.h"

#include "include/core/SkBlendMode.h"
#include "include/core/SkImageFilter.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPoint3.h"
#include "include/core/SkRRect.h"
#include "include/core/SkRSXform.h"
#include "include/core/SkRect.h"
#include "include/core/SkRegion.h"
#include "include/core/SkShader.h"
#include "include/core/SkSurface.h"
#include "include/core/SkTextBlob.h"
#include "include/private/base/SkPoint_impl.h"
#include "include/private/base/SkTo.h"
#include "include/private/chromium/Slug.h"
#include "src/core/SkCanvasPriv.h"
#include "src/core/SkDrawShadowInfo.h"
#include "src/core/SkMatrixPriv.h"
#include "src/core/SkSamplingPriv.h"
#include "src/utils/SkPatchUtils.h"

#include <utility>

class SkSurfaceProps;
enum class SkClipOp;
struct SkISize;
struct SkImageInfo;

usingnamespaceskia_private;

#define HEAP_BLOCK_SIZE

enum {};

// A lot of basic types get stored as a uint32_t: bools, ints, paint indices, etc.
static int const kUInt32Size =;

SkPictureRecord::SkPictureRecord(const SkIRect& dimensions, uint32_t flags)
    :{}

SkPictureRecord::SkPictureRecord(const SkISize& dimensions, uint32_t flags)
    :{}

void SkPictureRecord::willSave() {}

void SkPictureRecord::recordSave() {}

SkCanvas::SaveLayerStrategy SkPictureRecord::getSaveLayerStrategy(const SaveLayerRec& rec) {}

bool SkPictureRecord::onDoSaveBehind(const SkRect* subset) {}

void SkPictureRecord::recordSaveLayer(const SaveLayerRec& rec) {}

#ifdef SK_DEBUG
/*
 * Read the op code from 'offset' in 'writer' and extract the size too.
 */
static DrawType peek_op_and_size(SkWriter32* writer, size_t offset, uint32_t* size) {}
#endif//SK_DEBUG

void SkPictureRecord::willRestore() {}

void SkPictureRecord::recordRestore(bool fillInSkips) {}

void SkPictureRecord::recordTranslate(const SkMatrix& m) {}

void SkPictureRecord::recordScale(const SkMatrix& m) {}

void SkPictureRecord::didConcat44(const SkM44& m) {}

void SkPictureRecord::didSetM44(const SkM44& m) {}

void SkPictureRecord::didScale(SkScalar x, SkScalar y) {}

void SkPictureRecord::didTranslate(SkScalar x, SkScalar y) {}

void SkPictureRecord::recordConcat(const SkMatrix& matrix) {}

void SkPictureRecord::fillRestoreOffsetPlaceholdersForCurrentStackLevel(uint32_t restoreOffset) {}

void SkPictureRecord::beginRecording() {}

void SkPictureRecord::endRecording() {}

size_t SkPictureRecord::recordRestoreOffsetPlaceholder() {}

void SkPictureRecord::onClipRect(const SkRect& rect, SkClipOp op, ClipEdgeStyle edgeStyle) {}

size_t SkPictureRecord::recordClipRect(const SkRect& rect, SkClipOp op, bool doAA) {}

void SkPictureRecord::onClipRRect(const SkRRect& rrect, SkClipOp op, ClipEdgeStyle edgeStyle) {}

size_t SkPictureRecord::recordClipRRect(const SkRRect& rrect, SkClipOp op, bool doAA) {}

void SkPictureRecord::onClipPath(const SkPath& path, SkClipOp op, ClipEdgeStyle edgeStyle) {}

size_t SkPictureRecord::recordClipPath(int pathID, SkClipOp op, bool doAA) {}

void SkPictureRecord::onClipShader(sk_sp<SkShader> cs, SkClipOp op) {}

void SkPictureRecord::onClipRegion(const SkRegion& region, SkClipOp op) {}

size_t SkPictureRecord::recordClipRegion(const SkRegion& region, SkClipOp op) {}

void SkPictureRecord::onResetClip() {}

void SkPictureRecord::onDrawPaint(const SkPaint& paint) {}

void SkPictureRecord::onDrawBehind(const SkPaint& paint) {}

void SkPictureRecord::onDrawPoints(PointMode mode, size_t count, const SkPoint pts[],
                                   const SkPaint& paint) {}

void SkPictureRecord::onDrawOval(const SkRect& oval, const SkPaint& paint) {}

void SkPictureRecord::onDrawArc(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle,
                                bool useCenter, const SkPaint& paint) {}

void SkPictureRecord::onDrawRect(const SkRect& rect, const SkPaint& paint) {}

void SkPictureRecord::onDrawRegion(const SkRegion& region, const SkPaint& paint) {}

void SkPictureRecord::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) {}

void SkPictureRecord::onDrawDRRect(const SkRRect& outer, const SkRRect& inner,
                                   const SkPaint& paint) {}

void SkPictureRecord::onDrawPath(const SkPath& path, const SkPaint& paint) {}

void SkPictureRecord::onDrawImage2(const SkImage* image, SkScalar x, SkScalar y,
                                   const SkSamplingOptions& sampling, const SkPaint* paint) {}

void SkPictureRecord::onDrawImageRect2(const SkImage* image, const SkRect& src, const SkRect& dst,
                                       const SkSamplingOptions& sampling, const SkPaint* paint,
                                       SrcRectConstraint constraint) {}

void SkPictureRecord::onDrawImageLattice2(const SkImage* image, const Lattice& lattice,
                                          const SkRect& dst, SkFilterMode filter,
                                          const SkPaint* paint) {}

void SkPictureRecord::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
                                     const SkPaint& paint) {}

void SkPictureRecord::onDrawSlug(const sktext::gpu::Slug* slug, const SkPaint& paint) {}

void SkPictureRecord::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix,
                                    const SkPaint* paint) {}

void SkPictureRecord::onDrawDrawable(SkDrawable* drawable, const SkMatrix* matrix) {}

void SkPictureRecord::onDrawVerticesObject(const SkVertices* vertices,
                                           SkBlendMode mode, const SkPaint& paint) {}

void SkPictureRecord::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
                                  const SkPoint texCoords[4], SkBlendMode bmode,
                                  const SkPaint& paint) {}

void SkPictureRecord::onDrawAtlas2(const SkImage* atlas, const SkRSXform xform[], const SkRect tex[],
                                   const SkColor colors[], int count, SkBlendMode mode,
                                   const SkSamplingOptions& sampling, const SkRect* cull,
                                   const SkPaint* paint) {}

void SkPictureRecord::onDrawShadowRec(const SkPath& path, const SkDrawShadowRec& rec) {}

void SkPictureRecord::onDrawAnnotation(const SkRect& rect, const char key[], SkData* value) {}

void SkPictureRecord::onDrawEdgeAAQuad(const SkRect& rect, const SkPoint clip[4],
                                       SkCanvas::QuadAAFlags aa, const SkColor4f& color,
                                       SkBlendMode mode) {}

void SkPictureRecord::onDrawEdgeAAImageSet2(const SkCanvas::ImageSetEntry set[], int count,
                                            const SkPoint dstClips[],
                                            const SkMatrix preViewMatrices[],
                                            const SkSamplingOptions& sampling,
                                            const SkPaint* paint,
                                            SkCanvas::SrcRectConstraint constraint) {}

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

// De-duping helper.

template <typename T>
static bool equals(T* a, T* b) {}

template <>
bool equals(SkDrawable* a, SkDrawable* b) {}

template <typename T>
static int find_or_append(TArray<sk_sp<T>>& array, T* obj) {}

sk_sp<SkSurface> SkPictureRecord::onNewSurface(const SkImageInfo& info, const SkSurfaceProps&) {}

void SkPictureRecord::addImage(const SkImage* image) {}

void SkPictureRecord::addMatrix(const SkMatrix& matrix) {}

void SkPictureRecord::addPaintPtr(const SkPaint* paint) {}

int SkPictureRecord::addPathToHeap(const SkPath& path) {}

void SkPictureRecord::addPath(const SkPath& path) {}

void SkPictureRecord::addPatch(const SkPoint cubics[12]) {}

void SkPictureRecord::addPicture(const SkPicture* picture) {}

void SkPictureRecord::addDrawable(SkDrawable* drawable) {}

void SkPictureRecord::addPoint(const SkPoint& point) {}

void SkPictureRecord::addPoints(const SkPoint pts[], int count) {}

void SkPictureRecord::addNoOp() {}

void SkPictureRecord::addRect(const SkRect& rect) {}

void SkPictureRecord::addRectPtr(const SkRect* rect) {}

void SkPictureRecord::addIRect(const SkIRect& rect) {}

void SkPictureRecord::addIRectPtr(const SkIRect* rect) {}

void SkPictureRecord::addRRect(const SkRRect& rrect) {}

void SkPictureRecord::addRegion(const SkRegion& region) {}

void SkPictureRecord::addSampling(const SkSamplingOptions& sampling) {}

void SkPictureRecord::addText(const void* text, size_t byteLength) {}

void SkPictureRecord::addTextBlob(const SkTextBlob* blob) {}

void SkPictureRecord::addSlug(const sktext::gpu::Slug* slug) {}

void SkPictureRecord::addVertices(const SkVertices* vertices) {}