chromium/third_party/skia/src/core/SkRecorder.cpp

/*
 * Copyright 2014 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/SkRecorder.h"

#include "include/core/SkCanvas.h"
#include "include/core/SkData.h"
#include "include/core/SkDrawable.h"
#include "include/core/SkImage.h"
#include "include/core/SkImageFilter.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPicture.h"
#include "include/core/SkPoint.h"
#include "include/core/SkRSXform.h"
#include "include/core/SkRect.h"
#include "include/core/SkShader.h"
#include "include/core/SkString.h"
#include "include/core/SkSurface.h"
#include "include/core/SkTextBlob.h"
#include "include/core/SkVertices.h"
#include "include/private/base/SkFloatingPoint.h"
#include "include/private/base/SkTemplates.h"
#include "include/private/base/SkTo.h"
#include "include/private/chromium/Slug.h"
#include "src/core/SkBigPicture.h"
#include "src/core/SkCanvasPriv.h"
#include "src/core/SkRecord.h"
#include "src/core/SkRecords.h"
#include "src/text/GlyphRun.h"
#include "src/utils/SkPatchUtils.h"

#include <cstdint>
#include <cstring>
#include <memory>
#include <new>

class SkBlender;
class SkMesh;
class SkPath;
class SkRRect;
class SkRegion;
class SkSurfaceProps;
enum class SkBlendMode;
enum class SkClipOp;
struct SkDrawShadowRec;

usingnamespaceskia_private;

SkDrawableList::~SkDrawableList() {}

SkBigPicture::SnapshotArray* SkDrawableList::newDrawableSnapshot() {}

void SkDrawableList::append(SkDrawable* drawable) {}

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

static SkIRect safe_picture_bounds(const SkRect& bounds) {}

SkRecorder::SkRecorder(SkRecord* record, int width, int height)
        :{}

SkRecorder::SkRecorder(SkRecord* record, const SkRect& bounds)
        :{}

void SkRecorder::reset(SkRecord* record, const SkRect& bounds) {}

void SkRecorder::forgetRecord() {}

// To make appending to fRecord a little less verbose.
template<typename T, typename... Args>
void SkRecorder::append(Args&&... args) {}

// For methods which must call back into SkNoDrawCanvas.
#define INHERITED(method, ...)

// Use copy() only for optional arguments, to be copied if present or skipped if not.
// (For most types we just pass by value and let copy constructors do their thing.)
template <typename T>
T* SkRecorder::copy(const T* src) {}

// This copy() is for arrays.
// It will work with POD or non-POD, though currently we only use it for POD.
template <typename T>
T* SkRecorder::copy(const T src[], size_t count) {}

// Specialization for copying strings, using memcpy.
// This measured around 2x faster for copying code points,
// but I found no corresponding speedup for other arrays.
template <>
char* SkRecorder::copy(const char src[], size_t count) {}

// As above, assuming and copying a terminating \0.
template <>
char* SkRecorder::copy(const char* src) {}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

void SkRecorder::onDrawGlyphRunList(
        const sktext::GlyphRunList& glyphRunList, const SkPaint& paint) {}

void SkRecorder::onDrawPicture(const SkPicture* pic, const SkMatrix* matrix, const SkPaint* paint) {}

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

void SkRecorder::onDrawMesh(const SkMesh& mesh, sk_sp<SkBlender> blender, const SkPaint& paint) {}

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

void SkRecorder::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 SkRecorder::onDrawShadowRec(const SkPath& path, const SkDrawShadowRec& rec) {}

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

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

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

void SkRecorder::willSave() {}

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

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

void SkRecorder::didRestore() {}

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

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

void SkRecorder::didScale(SkScalar sx, SkScalar sy) {}

void SkRecorder::didTranslate(SkScalar dx, SkScalar dy) {}

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

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

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

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

void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkClipOp op) {}

void SkRecorder::onResetClip() {}

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