skia2/tools/debugger/DrawCommand.h

717 lines
21 KiB
C
Raw Normal View History

/*
* 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 SKDRAWCOMMAND_H_
#define SKDRAWCOMMAND_H_
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkFlattenable.h"
#include "include/core/SkPath.h"
#include "include/core/SkRRect.h"
#include "include/core/SkRSXform.h"
#include "include/core/SkRegion.h"
#include "include/core/SkString.h"
#include "include/core/SkVertices.h"
#include "include/private/SkTDArray.h"
#include "src/core/SkDrawShadowInfo.h"
#include "src/core/SkTLazy.h"
#include "src/utils/SkJSONWriter.h"
#include "tools/UrlDataManager.h"
class DebugLayerManager;
class DrawCommand {
public:
enum OpType {
kBeginDrawPicture_OpType,
kClear_OpType,
kClipPath_OpType,
kClipRegion_OpType,
kClipRect_OpType,
kClipRRect_OpType,
kClipShader_OpType,
kConcat_OpType,
kConcat44_OpType,
kDrawAnnotation_OpType,
kDrawBitmap_OpType,
kDrawBitmapRect_OpType,
kDrawDRRect_OpType,
kDrawImage_OpType,
kDrawImageLattice_OpType,
kDrawImageRect_OpType,
kDrawImageRectLayer_OpType, // unique to DebugCanvas
kDrawOval_OpType,
kDrawArc_OpType,
kDrawPaint_OpType,
kDrawPatch_OpType,
kDrawPath_OpType,
kDrawPoints_OpType,
kDrawRect_OpType,
kDrawRRect_OpType,
kDrawRegion_OpType,
kDrawShadow_OpType,
kDrawTextBlob_OpType,
kDrawVertices_OpType,
kDrawAtlas_OpType,
kDrawDrawable_OpType,
Reland "Reland "Update SkCanvas' experimental SkiaRenderer API"" This reverts commit 138a06d1b1cd035daf6b6a970c75126e94777822. Reason for revert: add explicit constructors to ImageSetEntry to account for the new arguments, matching SkiaRenderer's current initializer list. Also hardens SkPictureDrawback's deserialization code for drawEdgeAAImageSet and drawEdgeAAQuad from a fuzz that was found during the CL's brief lifespan. Original change's description: > Revert "Reland "Update SkCanvas' experimental SkiaRenderer API"" > > This reverts commit bd9d88a6e4d9730f3aa67227e5a1618180513a87. > > Reason for revert: Breaks SkiaRenderer on Android. Rendering is all corrupted, bisected to this change. > > Original change's description: > > Reland "Update SkCanvas' experimental SkiaRenderer API" > > > > This reverts commit 90791c202dd2d943565237bf511d929e8bd19951. > > > > Reason for revert: Jumped the gun, just need to update blacklist > > > > Original change's description: > > > Revert "Update SkCanvas' experimental SkiaRenderer API" > > > > > > This reverts commit 4bf964602ab8758f6e580aaaa69add4fb260c1a6. > > > > > > Reason for revert: vulkan dm crashes > > > > > > Original change's description: > > > > Update SkCanvas' experimental SkiaRenderer API > > > > > > > > This lifts the temporary functions in SkGpuDevice into SkCanvas and > > > > deprecates the older experimental_DrawImageSetV1 and > > > > experimental_DrawEdgeAARect. The new functions can handle paints and > > > > transform batching. Internally, SkCanvas routes the old functions to the > > > > new entry points and all device-level code is updated to handle the new > > > > API features. > > > > > > > > While touching all of the canvas/device/recording areas, the > > > > experimental functions are grouped in an "EdgeAA" cluster instead of being > > > > separated into the image category and the rectangle category. > > > > > > > > Bug: skia:8739 > > > > Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b > > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221 > > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > > > > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > > > > > Change-Id: I87a5a258c5a1bd15e16389cdf91743772d6fa98a > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Bug: skia:8739 > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201226 > > > Reviewed-by: Michael Ludwig <michaelludwig@google.com> > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > > > Change-Id: I75e9b6cbf079a7739b69a7e208730a930621abf9 > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: skia:8739 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201229 > > Reviewed-by: Michael Ludwig <michaelludwig@google.com> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > Auto-Submit: Michael Ludwig <michaelludwig@google.com> > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > Change-Id: Ib87ef9b8b8598c16a8a6915920adf0b5dffc644b > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:8739 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201391 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> Bug: skia:8739, oss-fuzz:13794 Change-Id: Ibd7df4a398928c3170d16300bf3ade496125372c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201650 Commit-Queue: Michael Ludwig <michaelludwig@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-19 13:16:38 +00:00
kDrawEdgeAAQuad_OpType,
kDrawEdgeAAImageSet_OpType,
kEndDrawPicture_OpType,
kRestore_OpType,
kSave_OpType,
kSaveLayer_OpType,
kSetMatrix_OpType,
kSetM44_OpType,
kLast_OpType = kSetM44_OpType
};
static const int kOpTypeCount = kLast_OpType + 1;
static void WritePNG(SkBitmap bitmap, SkWStream& out);
DrawCommand(OpType opType);
virtual ~DrawCommand() {}
bool isVisible() const { return fVisible; }
void setVisible(bool toggle) { fVisible = toggle; }
virtual void execute(SkCanvas*) const = 0;
virtual bool render(SkCanvas* canvas) const { return false; }
virtual void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const;
static const char* GetCommandString(OpType type);
// Helper methods for converting things to JSON
static void MakeJsonColor(SkJSONWriter&, const SkColor color);
static void MakeJsonColor4f(SkJSONWriter&, const SkColor4f& color);
static void MakeJsonPoint(SkJSONWriter&, const SkPoint& point);
static void MakeJsonPoint(SkJSONWriter&, SkScalar x, SkScalar y);
static void MakeJsonPoint3(SkJSONWriter&, const SkPoint3& point);
static void MakeJsonRect(SkJSONWriter&, const SkRect& rect);
static void MakeJsonIRect(SkJSONWriter&, const SkIRect&);
static void MakeJsonMatrix(SkJSONWriter&, const SkMatrix&);
static void MakeJsonMatrix44(SkJSONWriter&, const SkM44&);
static void MakeJsonPath(SkJSONWriter&, const SkPath& path);
static void MakeJsonRegion(SkJSONWriter&, const SkRegion& region);
static void MakeJsonPaint(SkJSONWriter&, const SkPaint& paint, UrlDataManager& urlDataManager);
static void MakeJsonLattice(SkJSONWriter&, const SkCanvas::Lattice& lattice);
static void flatten(const SkFlattenable* flattenable,
SkJSONWriter& writer,
UrlDataManager& urlDataManager);
static bool flatten(const SkImage& image, SkJSONWriter& writer, UrlDataManager& urlDataManager);
static bool flatten(const SkBitmap& bitmap,
SkJSONWriter& writer,
UrlDataManager& urlDataManager);
OpType getOpType() const { return fOpType; }
private:
OpType fOpType;
bool fVisible;
};
class RestoreCommand : public DrawCommand {
public:
RestoreCommand();
void execute(SkCanvas* canvas) const override;
private:
using INHERITED = DrawCommand;
};
class ClearCommand : public DrawCommand {
public:
ClearCommand(SkColor color);
void execute(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
SkColor fColor;
using INHERITED = DrawCommand;
};
class ClipPathCommand : public DrawCommand {
public:
ClipPathCommand(const SkPath& path, SkClipOp op, bool doAA);
void execute(SkCanvas* canvas) const override;
bool render(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
SkPath fPath;
SkClipOp fOp;
bool fDoAA;
using INHERITED = DrawCommand;
};
class ClipRegionCommand : public DrawCommand {
public:
ClipRegionCommand(const SkRegion& region, SkClipOp op);
void execute(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
SkRegion fRegion;
SkClipOp fOp;
using INHERITED = DrawCommand;
};
class ClipRectCommand : public DrawCommand {
public:
ClipRectCommand(const SkRect& rect, SkClipOp op, bool doAA);
void execute(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
SkRect fRect;
SkClipOp fOp;
bool fDoAA;
using INHERITED = DrawCommand;
};
class ClipRRectCommand : public DrawCommand {
public:
ClipRRectCommand(const SkRRect& rrect, SkClipOp op, bool doAA);
void execute(SkCanvas* canvas) const override;
bool render(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
SkRRect fRRect;
SkClipOp fOp;
bool fDoAA;
using INHERITED = DrawCommand;
};
class ClipShaderCommand : public DrawCommand {
public:
ClipShaderCommand(sk_sp<SkShader>, SkClipOp);
void execute(SkCanvas* canvas) const override;
bool render(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
sk_sp<SkShader> fShader;
SkClipOp fOp;
using INHERITED = DrawCommand;
};
class ConcatCommand : public DrawCommand {
public:
ConcatCommand(const SkMatrix& matrix);
void execute(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
SkMatrix fMatrix;
using INHERITED = DrawCommand;
};
class Concat44Command : public DrawCommand {
public:
Concat44Command(const SkM44& matrix);
void execute(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
SkM44 fMatrix;
using INHERITED = DrawCommand;
};
class DrawAnnotationCommand : public DrawCommand {
public:
DrawAnnotationCommand(const SkRect&, const char key[], sk_sp<SkData> value);
void execute(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
SkRect fRect;
SkString fKey;
sk_sp<SkData> fValue;
using INHERITED = DrawCommand;
};
class DrawImageCommand : public DrawCommand {
public:
DrawImageCommand(const SkImage* image, SkScalar left, SkScalar top,
const SkSamplingOptions&, const SkPaint* paint);
void execute(SkCanvas* canvas) const override;
bool render(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
uint64_t imageId(UrlDataManager& udb) const;
private:
sk_sp<const SkImage> fImage;
SkScalar fLeft;
SkScalar fTop;
SkSamplingOptions fSampling;
SkTLazy<SkPaint> fPaint;
using INHERITED = DrawCommand;
};
class DrawImageLatticeCommand : public DrawCommand {
public:
DrawImageLatticeCommand(const SkImage* image,
const SkCanvas::Lattice& lattice,
const SkRect& dst,
const SkPaint* paint);
void execute(SkCanvas* canvas) const override;
bool render(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
uint64_t imageId(UrlDataManager& udb) const;
private:
sk_sp<const SkImage> fImage;
SkCanvas::Lattice fLattice;
SkRect fDst;
SkTLazy<SkPaint> fPaint;
using INHERITED = DrawCommand;
};
class DrawImageRectCommand : public DrawCommand {
public:
DrawImageRectCommand(const SkImage* image,
const SkRect& src,
const SkRect& dst,
const SkSamplingOptions& sampling,
const SkPaint* paint,
SkCanvas::SrcRectConstraint constraint);
void execute(SkCanvas* canvas) const override;
bool render(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
uint64_t imageId(UrlDataManager& udm) const;
private:
sk_sp<const SkImage> fImage;
SkRect fSrc;
SkRect fDst;
SkSamplingOptions fSampling;
SkTLazy<SkPaint> fPaint;
SkCanvas::SrcRectConstraint fConstraint;
using INHERITED = DrawCommand;
};
// Command for resolving the deferred SkImage representing an android layer
// Functions like DrawImageRect except it uses the saved UrlDataManager to resolve the image
// at the time execute() is called.
class DrawImageRectLayerCommand : public DrawCommand {
public:
DrawImageRectLayerCommand(DebugLayerManager* layerManager,
const int nodeId,
const int frame,
const SkRect& src,
const SkRect& dst,
const SkSamplingOptions& sampling,
const SkPaint* paint,
SkCanvas::SrcRectConstraint constraint);
void execute(SkCanvas* canvas) const override;
bool render(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
DebugLayerManager* fLayerManager;
int fNodeId;
int fFrame;
SkRect fSrc;
SkRect fDst;
SkSamplingOptions fSampling;
SkTLazy<SkPaint> fPaint;
SkCanvas::SrcRectConstraint fConstraint;
using INHERITED = DrawCommand;
};
class DrawOvalCommand : public DrawCommand {
public:
DrawOvalCommand(const SkRect& oval, const SkPaint& paint);
void execute(SkCanvas* canvas) const override;
bool render(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
SkRect fOval;
SkPaint fPaint;
using INHERITED = DrawCommand;
};
class DrawArcCommand : public DrawCommand {
public:
DrawArcCommand(const SkRect& oval,
SkScalar startAngle,
SkScalar sweepAngle,
bool useCenter,
const SkPaint& paint);
void execute(SkCanvas* canvas) const override;
bool render(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
SkRect fOval;
SkScalar fStartAngle;
SkScalar fSweepAngle;
bool fUseCenter;
SkPaint fPaint;
using INHERITED = DrawCommand;
};
class DrawPaintCommand : public DrawCommand {
public:
DrawPaintCommand(const SkPaint& paint);
void execute(SkCanvas* canvas) const override;
bool render(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
SkPaint fPaint;
using INHERITED = DrawCommand;
};
class DrawBehindCommand : public DrawCommand {
public:
DrawBehindCommand(const SkPaint& paint);
void execute(SkCanvas* canvas) const override;
bool render(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
SkPaint fPaint;
using INHERITED = DrawCommand;
};
class DrawPathCommand : public DrawCommand {
public:
DrawPathCommand(const SkPath& path, const SkPaint& paint);
void execute(SkCanvas* canvas) const override;
bool render(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
SkPath fPath;
SkPaint fPaint;
using INHERITED = DrawCommand;
};
class BeginDrawPictureCommand : public DrawCommand {
public:
BeginDrawPictureCommand(const SkPicture* picture, const SkMatrix* matrix, const SkPaint* paint);
void execute(SkCanvas* canvas) const override;
bool render(SkCanvas* canvas) const override;
private:
sk_sp<const SkPicture> fPicture;
SkTLazy<SkMatrix> fMatrix;
SkTLazy<SkPaint> fPaint;
using INHERITED = DrawCommand;
};
class EndDrawPictureCommand : public DrawCommand {
public:
EndDrawPictureCommand(bool restore);
void execute(SkCanvas* canvas) const override;
private:
bool fRestore;
using INHERITED = DrawCommand;
};
class DrawPointsCommand : public DrawCommand {
public:
DrawPointsCommand(SkCanvas::PointMode mode,
size_t count,
const SkPoint pts[],
const SkPaint& paint);
void execute(SkCanvas* canvas) const override;
bool render(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
SkCanvas::PointMode fMode;
SkTDArray<SkPoint> fPts;
SkPaint fPaint;
using INHERITED = DrawCommand;
};
class DrawRegionCommand : public DrawCommand {
public:
DrawRegionCommand(const SkRegion& region, const SkPaint& paint);
void execute(SkCanvas* canvas) const override;
bool render(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
SkRegion fRegion;
SkPaint fPaint;
using INHERITED = DrawCommand;
};
class DrawTextBlobCommand : public DrawCommand {
public:
DrawTextBlobCommand(sk_sp<SkTextBlob> blob, SkScalar x, SkScalar y, const SkPaint& paint);
void execute(SkCanvas* canvas) const override;
bool render(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
sk_sp<SkTextBlob> fBlob;
SkScalar fXPos;
SkScalar fYPos;
SkPaint fPaint;
using INHERITED = DrawCommand;
};
class DrawPatchCommand : public DrawCommand {
public:
DrawPatchCommand(const SkPoint cubics[12],
const SkColor colors[4],
const SkPoint texCoords[4],
SkBlendMode bmode,
const SkPaint& paint);
void execute(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
SkPoint fCubics[12];
SkColor* fColorsPtr;
SkColor fColors[4];
SkPoint* fTexCoordsPtr;
SkPoint fTexCoords[4];
SkBlendMode fBlendMode;
SkPaint fPaint;
using INHERITED = DrawCommand;
};
class DrawRectCommand : public DrawCommand {
public:
DrawRectCommand(const SkRect& rect, const SkPaint& paint);
void execute(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
SkRect fRect;
SkPaint fPaint;
using INHERITED = DrawCommand;
};
class DrawRRectCommand : public DrawCommand {
public:
DrawRRectCommand(const SkRRect& rrect, const SkPaint& paint);
void execute(SkCanvas* canvas) const override;
bool render(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
SkRRect fRRect;
SkPaint fPaint;
using INHERITED = DrawCommand;
};
class DrawDRRectCommand : public DrawCommand {
public:
DrawDRRectCommand(const SkRRect& outer, const SkRRect& inner, const SkPaint& paint);
void execute(SkCanvas* canvas) const override;
bool render(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
SkRRect fOuter;
SkRRect fInner;
SkPaint fPaint;
using INHERITED = DrawCommand;
};
class DrawVerticesCommand : public DrawCommand {
public:
DrawVerticesCommand(sk_sp<SkVertices>, SkBlendMode, const SkPaint&);
void execute(SkCanvas* canvas) const override;
private:
sk_sp<SkVertices> fVertices;
SkBlendMode fBlendMode;
SkPaint fPaint;
using INHERITED = DrawCommand;
};
class DrawAtlasCommand : public DrawCommand {
public:
DrawAtlasCommand(const SkImage*,
const SkRSXform[],
const SkRect[],
const SkColor[],
int,
SkBlendMode,
const SkRect*,
const SkPaint*);
void execute(SkCanvas* canvas) const override;
private:
sk_sp<const SkImage> fImage;
SkTDArray<SkRSXform> fXform;
SkTDArray<SkRect> fTex;
SkTDArray<SkColor> fColors;
SkBlendMode fBlendMode;
SkTLazy<SkRect> fCull;
SkTLazy<SkPaint> fPaint;
using INHERITED = DrawCommand;
};
class SaveCommand : public DrawCommand {
public:
SaveCommand();
void execute(SkCanvas* canvas) const override;
private:
using INHERITED = DrawCommand;
};
class SaveLayerCommand : public DrawCommand {
public:
SaveLayerCommand(const SkCanvas::SaveLayerRec&);
void execute(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
SkTLazy<SkRect> fBounds;
SkTLazy<SkPaint> fPaint;
sk_sp<const SkImageFilter> fBackdrop;
uint32_t fSaveLayerFlags;
using INHERITED = DrawCommand;
};
class SetMatrixCommand : public DrawCommand {
public:
SetMatrixCommand(const SkMatrix& matrix);
void execute(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
SkMatrix fMatrix;
using INHERITED = DrawCommand;
};
class SetM44Command : public DrawCommand {
public:
SetM44Command(const SkM44& matrix);
void execute(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
SkM44 fMatrix;
using INHERITED = DrawCommand;
};
class DrawShadowCommand : public DrawCommand {
public:
DrawShadowCommand(const SkPath& path, const SkDrawShadowRec& rec);
void execute(SkCanvas* canvas) const override;
bool render(SkCanvas* canvas) const override;
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
private:
SkPath fPath;
SkDrawShadowRec fShadowRec;
using INHERITED = DrawCommand;
};
class DrawDrawableCommand : public DrawCommand {
public:
DrawDrawableCommand(SkDrawable*, const SkMatrix*);
void execute(SkCanvas* canvas) const override;
private:
sk_sp<SkDrawable> fDrawable;
SkTLazy<SkMatrix> fMatrix;
using INHERITED = DrawCommand;
};
Reland "Reland "Update SkCanvas' experimental SkiaRenderer API"" This reverts commit 138a06d1b1cd035daf6b6a970c75126e94777822. Reason for revert: add explicit constructors to ImageSetEntry to account for the new arguments, matching SkiaRenderer's current initializer list. Also hardens SkPictureDrawback's deserialization code for drawEdgeAAImageSet and drawEdgeAAQuad from a fuzz that was found during the CL's brief lifespan. Original change's description: > Revert "Reland "Update SkCanvas' experimental SkiaRenderer API"" > > This reverts commit bd9d88a6e4d9730f3aa67227e5a1618180513a87. > > Reason for revert: Breaks SkiaRenderer on Android. Rendering is all corrupted, bisected to this change. > > Original change's description: > > Reland "Update SkCanvas' experimental SkiaRenderer API" > > > > This reverts commit 90791c202dd2d943565237bf511d929e8bd19951. > > > > Reason for revert: Jumped the gun, just need to update blacklist > > > > Original change's description: > > > Revert "Update SkCanvas' experimental SkiaRenderer API" > > > > > > This reverts commit 4bf964602ab8758f6e580aaaa69add4fb260c1a6. > > > > > > Reason for revert: vulkan dm crashes > > > > > > Original change's description: > > > > Update SkCanvas' experimental SkiaRenderer API > > > > > > > > This lifts the temporary functions in SkGpuDevice into SkCanvas and > > > > deprecates the older experimental_DrawImageSetV1 and > > > > experimental_DrawEdgeAARect. The new functions can handle paints and > > > > transform batching. Internally, SkCanvas routes the old functions to the > > > > new entry points and all device-level code is updated to handle the new > > > > API features. > > > > > > > > While touching all of the canvas/device/recording areas, the > > > > experimental functions are grouped in an "EdgeAA" cluster instead of being > > > > separated into the image category and the rectangle category. > > > > > > > > Bug: skia:8739 > > > > Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b > > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221 > > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > > > > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > > > > > Change-Id: I87a5a258c5a1bd15e16389cdf91743772d6fa98a > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Bug: skia:8739 > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201226 > > > Reviewed-by: Michael Ludwig <michaelludwig@google.com> > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > > > Change-Id: I75e9b6cbf079a7739b69a7e208730a930621abf9 > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: skia:8739 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201229 > > Reviewed-by: Michael Ludwig <michaelludwig@google.com> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > Auto-Submit: Michael Ludwig <michaelludwig@google.com> > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > Change-Id: Ib87ef9b8b8598c16a8a6915920adf0b5dffc644b > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:8739 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201391 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> Bug: skia:8739, oss-fuzz:13794 Change-Id: Ibd7df4a398928c3170d16300bf3ade496125372c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201650 Commit-Queue: Michael Ludwig <michaelludwig@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-19 13:16:38 +00:00
class DrawEdgeAAQuadCommand : public DrawCommand {
Reland "Reland "Update SkCanvas' experimental SkiaRenderer API"" This reverts commit 138a06d1b1cd035daf6b6a970c75126e94777822. Reason for revert: add explicit constructors to ImageSetEntry to account for the new arguments, matching SkiaRenderer's current initializer list. Also hardens SkPictureDrawback's deserialization code for drawEdgeAAImageSet and drawEdgeAAQuad from a fuzz that was found during the CL's brief lifespan. Original change's description: > Revert "Reland "Update SkCanvas' experimental SkiaRenderer API"" > > This reverts commit bd9d88a6e4d9730f3aa67227e5a1618180513a87. > > Reason for revert: Breaks SkiaRenderer on Android. Rendering is all corrupted, bisected to this change. > > Original change's description: > > Reland "Update SkCanvas' experimental SkiaRenderer API" > > > > This reverts commit 90791c202dd2d943565237bf511d929e8bd19951. > > > > Reason for revert: Jumped the gun, just need to update blacklist > > > > Original change's description: > > > Revert "Update SkCanvas' experimental SkiaRenderer API" > > > > > > This reverts commit 4bf964602ab8758f6e580aaaa69add4fb260c1a6. > > > > > > Reason for revert: vulkan dm crashes > > > > > > Original change's description: > > > > Update SkCanvas' experimental SkiaRenderer API > > > > > > > > This lifts the temporary functions in SkGpuDevice into SkCanvas and > > > > deprecates the older experimental_DrawImageSetV1 and > > > > experimental_DrawEdgeAARect. The new functions can handle paints and > > > > transform batching. Internally, SkCanvas routes the old functions to the > > > > new entry points and all device-level code is updated to handle the new > > > > API features. > > > > > > > > While touching all of the canvas/device/recording areas, the > > > > experimental functions are grouped in an "EdgeAA" cluster instead of being > > > > separated into the image category and the rectangle category. > > > > > > > > Bug: skia:8739 > > > > Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b > > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221 > > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > > > > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > > > > > Change-Id: I87a5a258c5a1bd15e16389cdf91743772d6fa98a > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Bug: skia:8739 > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201226 > > > Reviewed-by: Michael Ludwig <michaelludwig@google.com> > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > > > Change-Id: I75e9b6cbf079a7739b69a7e208730a930621abf9 > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: skia:8739 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201229 > > Reviewed-by: Michael Ludwig <michaelludwig@google.com> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > Auto-Submit: Michael Ludwig <michaelludwig@google.com> > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > Change-Id: Ib87ef9b8b8598c16a8a6915920adf0b5dffc644b > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:8739 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201391 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> Bug: skia:8739, oss-fuzz:13794 Change-Id: Ibd7df4a398928c3170d16300bf3ade496125372c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201650 Commit-Queue: Michael Ludwig <michaelludwig@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-19 13:16:38 +00:00
public:
DrawEdgeAAQuadCommand(const SkRect& rect,
const SkPoint clip[4],
SkCanvas::QuadAAFlags aa,
const SkColor4f& color,
SkBlendMode mode);
Reland "Reland "Update SkCanvas' experimental SkiaRenderer API"" This reverts commit 138a06d1b1cd035daf6b6a970c75126e94777822. Reason for revert: add explicit constructors to ImageSetEntry to account for the new arguments, matching SkiaRenderer's current initializer list. Also hardens SkPictureDrawback's deserialization code for drawEdgeAAImageSet and drawEdgeAAQuad from a fuzz that was found during the CL's brief lifespan. Original change's description: > Revert "Reland "Update SkCanvas' experimental SkiaRenderer API"" > > This reverts commit bd9d88a6e4d9730f3aa67227e5a1618180513a87. > > Reason for revert: Breaks SkiaRenderer on Android. Rendering is all corrupted, bisected to this change. > > Original change's description: > > Reland "Update SkCanvas' experimental SkiaRenderer API" > > > > This reverts commit 90791c202dd2d943565237bf511d929e8bd19951. > > > > Reason for revert: Jumped the gun, just need to update blacklist > > > > Original change's description: > > > Revert "Update SkCanvas' experimental SkiaRenderer API" > > > > > > This reverts commit 4bf964602ab8758f6e580aaaa69add4fb260c1a6. > > > > > > Reason for revert: vulkan dm crashes > > > > > > Original change's description: > > > > Update SkCanvas' experimental SkiaRenderer API > > > > > > > > This lifts the temporary functions in SkGpuDevice into SkCanvas and > > > > deprecates the older experimental_DrawImageSetV1 and > > > > experimental_DrawEdgeAARect. The new functions can handle paints and > > > > transform batching. Internally, SkCanvas routes the old functions to the > > > > new entry points and all device-level code is updated to handle the new > > > > API features. > > > > > > > > While touching all of the canvas/device/recording areas, the > > > > experimental functions are grouped in an "EdgeAA" cluster instead of being > > > > separated into the image category and the rectangle category. > > > > > > > > Bug: skia:8739 > > > > Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b > > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221 > > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > > > > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > > > > > Change-Id: I87a5a258c5a1bd15e16389cdf91743772d6fa98a > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Bug: skia:8739 > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201226 > > > Reviewed-by: Michael Ludwig <michaelludwig@google.com> > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > > > Change-Id: I75e9b6cbf079a7739b69a7e208730a930621abf9 > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: skia:8739 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201229 > > Reviewed-by: Michael Ludwig <michaelludwig@google.com> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > Auto-Submit: Michael Ludwig <michaelludwig@google.com> > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > Change-Id: Ib87ef9b8b8598c16a8a6915920adf0b5dffc644b > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:8739 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201391 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> Bug: skia:8739, oss-fuzz:13794 Change-Id: Ibd7df4a398928c3170d16300bf3ade496125372c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201650 Commit-Queue: Michael Ludwig <michaelludwig@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-19 13:16:38 +00:00
void execute(SkCanvas* canvas) const override;
private:
SkRect fRect;
SkPoint fClip[4];
int fHasClip;
Reland "Reland "Update SkCanvas' experimental SkiaRenderer API"" This reverts commit 138a06d1b1cd035daf6b6a970c75126e94777822. Reason for revert: add explicit constructors to ImageSetEntry to account for the new arguments, matching SkiaRenderer's current initializer list. Also hardens SkPictureDrawback's deserialization code for drawEdgeAAImageSet and drawEdgeAAQuad from a fuzz that was found during the CL's brief lifespan. Original change's description: > Revert "Reland "Update SkCanvas' experimental SkiaRenderer API"" > > This reverts commit bd9d88a6e4d9730f3aa67227e5a1618180513a87. > > Reason for revert: Breaks SkiaRenderer on Android. Rendering is all corrupted, bisected to this change. > > Original change's description: > > Reland "Update SkCanvas' experimental SkiaRenderer API" > > > > This reverts commit 90791c202dd2d943565237bf511d929e8bd19951. > > > > Reason for revert: Jumped the gun, just need to update blacklist > > > > Original change's description: > > > Revert "Update SkCanvas' experimental SkiaRenderer API" > > > > > > This reverts commit 4bf964602ab8758f6e580aaaa69add4fb260c1a6. > > > > > > Reason for revert: vulkan dm crashes > > > > > > Original change's description: > > > > Update SkCanvas' experimental SkiaRenderer API > > > > > > > > This lifts the temporary functions in SkGpuDevice into SkCanvas and > > > > deprecates the older experimental_DrawImageSetV1 and > > > > experimental_DrawEdgeAARect. The new functions can handle paints and > > > > transform batching. Internally, SkCanvas routes the old functions to the > > > > new entry points and all device-level code is updated to handle the new > > > > API features. > > > > > > > > While touching all of the canvas/device/recording areas, the > > > > experimental functions are grouped in an "EdgeAA" cluster instead of being > > > > separated into the image category and the rectangle category. > > > > > > > > Bug: skia:8739 > > > > Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b > > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221 > > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > > > > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > > > > > Change-Id: I87a5a258c5a1bd15e16389cdf91743772d6fa98a > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Bug: skia:8739 > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201226 > > > Reviewed-by: Michael Ludwig <michaelludwig@google.com> > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > > > Change-Id: I75e9b6cbf079a7739b69a7e208730a930621abf9 > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: skia:8739 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201229 > > Reviewed-by: Michael Ludwig <michaelludwig@google.com> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > Auto-Submit: Michael Ludwig <michaelludwig@google.com> > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > Change-Id: Ib87ef9b8b8598c16a8a6915920adf0b5dffc644b > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:8739 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201391 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> Bug: skia:8739, oss-fuzz:13794 Change-Id: Ibd7df4a398928c3170d16300bf3ade496125372c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201650 Commit-Queue: Michael Ludwig <michaelludwig@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-19 13:16:38 +00:00
SkCanvas::QuadAAFlags fAA;
SkColor4f fColor;
SkBlendMode fMode;
Reland "Reland "Update SkCanvas' experimental SkiaRenderer API"" This reverts commit 138a06d1b1cd035daf6b6a970c75126e94777822. Reason for revert: add explicit constructors to ImageSetEntry to account for the new arguments, matching SkiaRenderer's current initializer list. Also hardens SkPictureDrawback's deserialization code for drawEdgeAAImageSet and drawEdgeAAQuad from a fuzz that was found during the CL's brief lifespan. Original change's description: > Revert "Reland "Update SkCanvas' experimental SkiaRenderer API"" > > This reverts commit bd9d88a6e4d9730f3aa67227e5a1618180513a87. > > Reason for revert: Breaks SkiaRenderer on Android. Rendering is all corrupted, bisected to this change. > > Original change's description: > > Reland "Update SkCanvas' experimental SkiaRenderer API" > > > > This reverts commit 90791c202dd2d943565237bf511d929e8bd19951. > > > > Reason for revert: Jumped the gun, just need to update blacklist > > > > Original change's description: > > > Revert "Update SkCanvas' experimental SkiaRenderer API" > > > > > > This reverts commit 4bf964602ab8758f6e580aaaa69add4fb260c1a6. > > > > > > Reason for revert: vulkan dm crashes > > > > > > Original change's description: > > > > Update SkCanvas' experimental SkiaRenderer API > > > > > > > > This lifts the temporary functions in SkGpuDevice into SkCanvas and > > > > deprecates the older experimental_DrawImageSetV1 and > > > > experimental_DrawEdgeAARect. The new functions can handle paints and > > > > transform batching. Internally, SkCanvas routes the old functions to the > > > > new entry points and all device-level code is updated to handle the new > > > > API features. > > > > > > > > While touching all of the canvas/device/recording areas, the > > > > experimental functions are grouped in an "EdgeAA" cluster instead of being > > > > separated into the image category and the rectangle category. > > > > > > > > Bug: skia:8739 > > > > Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b > > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221 > > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > > > > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > > > > > Change-Id: I87a5a258c5a1bd15e16389cdf91743772d6fa98a > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Bug: skia:8739 > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201226 > > > Reviewed-by: Michael Ludwig <michaelludwig@google.com> > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > > > Change-Id: I75e9b6cbf079a7739b69a7e208730a930621abf9 > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: skia:8739 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201229 > > Reviewed-by: Michael Ludwig <michaelludwig@google.com> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > Auto-Submit: Michael Ludwig <michaelludwig@google.com> > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > Change-Id: Ib87ef9b8b8598c16a8a6915920adf0b5dffc644b > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:8739 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201391 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> Bug: skia:8739, oss-fuzz:13794 Change-Id: Ibd7df4a398928c3170d16300bf3ade496125372c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201650 Commit-Queue: Michael Ludwig <michaelludwig@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-19 13:16:38 +00:00
using INHERITED = DrawCommand;
Reland "Reland "Update SkCanvas' experimental SkiaRenderer API"" This reverts commit 138a06d1b1cd035daf6b6a970c75126e94777822. Reason for revert: add explicit constructors to ImageSetEntry to account for the new arguments, matching SkiaRenderer's current initializer list. Also hardens SkPictureDrawback's deserialization code for drawEdgeAAImageSet and drawEdgeAAQuad from a fuzz that was found during the CL's brief lifespan. Original change's description: > Revert "Reland "Update SkCanvas' experimental SkiaRenderer API"" > > This reverts commit bd9d88a6e4d9730f3aa67227e5a1618180513a87. > > Reason for revert: Breaks SkiaRenderer on Android. Rendering is all corrupted, bisected to this change. > > Original change's description: > > Reland "Update SkCanvas' experimental SkiaRenderer API" > > > > This reverts commit 90791c202dd2d943565237bf511d929e8bd19951. > > > > Reason for revert: Jumped the gun, just need to update blacklist > > > > Original change's description: > > > Revert "Update SkCanvas' experimental SkiaRenderer API" > > > > > > This reverts commit 4bf964602ab8758f6e580aaaa69add4fb260c1a6. > > > > > > Reason for revert: vulkan dm crashes > > > > > > Original change's description: > > > > Update SkCanvas' experimental SkiaRenderer API > > > > > > > > This lifts the temporary functions in SkGpuDevice into SkCanvas and > > > > deprecates the older experimental_DrawImageSetV1 and > > > > experimental_DrawEdgeAARect. The new functions can handle paints and > > > > transform batching. Internally, SkCanvas routes the old functions to the > > > > new entry points and all device-level code is updated to handle the new > > > > API features. > > > > > > > > While touching all of the canvas/device/recording areas, the > > > > experimental functions are grouped in an "EdgeAA" cluster instead of being > > > > separated into the image category and the rectangle category. > > > > > > > > Bug: skia:8739 > > > > Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b > > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221 > > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > > > > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > > > > > Change-Id: I87a5a258c5a1bd15e16389cdf91743772d6fa98a > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Bug: skia:8739 > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201226 > > > Reviewed-by: Michael Ludwig <michaelludwig@google.com> > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > > > Change-Id: I75e9b6cbf079a7739b69a7e208730a930621abf9 > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: skia:8739 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201229 > > Reviewed-by: Michael Ludwig <michaelludwig@google.com> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > Auto-Submit: Michael Ludwig <michaelludwig@google.com> > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > Change-Id: Ib87ef9b8b8598c16a8a6915920adf0b5dffc644b > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:8739 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201391 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> Bug: skia:8739, oss-fuzz:13794 Change-Id: Ibd7df4a398928c3170d16300bf3ade496125372c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201650 Commit-Queue: Michael Ludwig <michaelludwig@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-19 13:16:38 +00:00
};
class DrawEdgeAAImageSetCommand : public DrawCommand {
Reland "Reland "Update SkCanvas' experimental SkiaRenderer API"" This reverts commit 138a06d1b1cd035daf6b6a970c75126e94777822. Reason for revert: add explicit constructors to ImageSetEntry to account for the new arguments, matching SkiaRenderer's current initializer list. Also hardens SkPictureDrawback's deserialization code for drawEdgeAAImageSet and drawEdgeAAQuad from a fuzz that was found during the CL's brief lifespan. Original change's description: > Revert "Reland "Update SkCanvas' experimental SkiaRenderer API"" > > This reverts commit bd9d88a6e4d9730f3aa67227e5a1618180513a87. > > Reason for revert: Breaks SkiaRenderer on Android. Rendering is all corrupted, bisected to this change. > > Original change's description: > > Reland "Update SkCanvas' experimental SkiaRenderer API" > > > > This reverts commit 90791c202dd2d943565237bf511d929e8bd19951. > > > > Reason for revert: Jumped the gun, just need to update blacklist > > > > Original change's description: > > > Revert "Update SkCanvas' experimental SkiaRenderer API" > > > > > > This reverts commit 4bf964602ab8758f6e580aaaa69add4fb260c1a6. > > > > > > Reason for revert: vulkan dm crashes > > > > > > Original change's description: > > > > Update SkCanvas' experimental SkiaRenderer API > > > > > > > > This lifts the temporary functions in SkGpuDevice into SkCanvas and > > > > deprecates the older experimental_DrawImageSetV1 and > > > > experimental_DrawEdgeAARect. The new functions can handle paints and > > > > transform batching. Internally, SkCanvas routes the old functions to the > > > > new entry points and all device-level code is updated to handle the new > > > > API features. > > > > > > > > While touching all of the canvas/device/recording areas, the > > > > experimental functions are grouped in an "EdgeAA" cluster instead of being > > > > separated into the image category and the rectangle category. > > > > > > > > Bug: skia:8739 > > > > Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b > > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221 > > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > > > > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > > > > > Change-Id: I87a5a258c5a1bd15e16389cdf91743772d6fa98a > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Bug: skia:8739 > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201226 > > > Reviewed-by: Michael Ludwig <michaelludwig@google.com> > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > > > Change-Id: I75e9b6cbf079a7739b69a7e208730a930621abf9 > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: skia:8739 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201229 > > Reviewed-by: Michael Ludwig <michaelludwig@google.com> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > Auto-Submit: Michael Ludwig <michaelludwig@google.com> > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > Change-Id: Ib87ef9b8b8598c16a8a6915920adf0b5dffc644b > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:8739 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201391 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> Bug: skia:8739, oss-fuzz:13794 Change-Id: Ibd7df4a398928c3170d16300bf3ade496125372c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201650 Commit-Queue: Michael Ludwig <michaelludwig@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-19 13:16:38 +00:00
public:
DrawEdgeAAImageSetCommand(const SkCanvas::ImageSetEntry[],
int count,
const SkPoint[],
const SkMatrix[],
const SkSamplingOptions&,
const SkPaint*,
SkCanvas::SrcRectConstraint);
Reland "Reland "Update SkCanvas' experimental SkiaRenderer API"" This reverts commit 138a06d1b1cd035daf6b6a970c75126e94777822. Reason for revert: add explicit constructors to ImageSetEntry to account for the new arguments, matching SkiaRenderer's current initializer list. Also hardens SkPictureDrawback's deserialization code for drawEdgeAAImageSet and drawEdgeAAQuad from a fuzz that was found during the CL's brief lifespan. Original change's description: > Revert "Reland "Update SkCanvas' experimental SkiaRenderer API"" > > This reverts commit bd9d88a6e4d9730f3aa67227e5a1618180513a87. > > Reason for revert: Breaks SkiaRenderer on Android. Rendering is all corrupted, bisected to this change. > > Original change's description: > > Reland "Update SkCanvas' experimental SkiaRenderer API" > > > > This reverts commit 90791c202dd2d943565237bf511d929e8bd19951. > > > > Reason for revert: Jumped the gun, just need to update blacklist > > > > Original change's description: > > > Revert "Update SkCanvas' experimental SkiaRenderer API" > > > > > > This reverts commit 4bf964602ab8758f6e580aaaa69add4fb260c1a6. > > > > > > Reason for revert: vulkan dm crashes > > > > > > Original change's description: > > > > Update SkCanvas' experimental SkiaRenderer API > > > > > > > > This lifts the temporary functions in SkGpuDevice into SkCanvas and > > > > deprecates the older experimental_DrawImageSetV1 and > > > > experimental_DrawEdgeAARect. The new functions can handle paints and > > > > transform batching. Internally, SkCanvas routes the old functions to the > > > > new entry points and all device-level code is updated to handle the new > > > > API features. > > > > > > > > While touching all of the canvas/device/recording areas, the > > > > experimental functions are grouped in an "EdgeAA" cluster instead of being > > > > separated into the image category and the rectangle category. > > > > > > > > Bug: skia:8739 > > > > Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b > > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221 > > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > > > > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > > > > > Change-Id: I87a5a258c5a1bd15e16389cdf91743772d6fa98a > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Bug: skia:8739 > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201226 > > > Reviewed-by: Michael Ludwig <michaelludwig@google.com> > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > > > Change-Id: I75e9b6cbf079a7739b69a7e208730a930621abf9 > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: skia:8739 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201229 > > Reviewed-by: Michael Ludwig <michaelludwig@google.com> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > Auto-Submit: Michael Ludwig <michaelludwig@google.com> > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > Change-Id: Ib87ef9b8b8598c16a8a6915920adf0b5dffc644b > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:8739 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201391 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> Bug: skia:8739, oss-fuzz:13794 Change-Id: Ibd7df4a398928c3170d16300bf3ade496125372c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201650 Commit-Queue: Michael Ludwig <michaelludwig@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-19 13:16:38 +00:00
void execute(SkCanvas* canvas) const override;
private:
SkAutoTArray<SkCanvas::ImageSetEntry> fSet;
int fCount;
SkAutoTArray<SkPoint> fDstClips;
SkAutoTArray<SkMatrix> fPreViewMatrices;
SkSamplingOptions fSampling;
SkTLazy<SkPaint> fPaint;
SkCanvas::SrcRectConstraint fConstraint;
Reland "Reland "Update SkCanvas' experimental SkiaRenderer API"" This reverts commit 138a06d1b1cd035daf6b6a970c75126e94777822. Reason for revert: add explicit constructors to ImageSetEntry to account for the new arguments, matching SkiaRenderer's current initializer list. Also hardens SkPictureDrawback's deserialization code for drawEdgeAAImageSet and drawEdgeAAQuad from a fuzz that was found during the CL's brief lifespan. Original change's description: > Revert "Reland "Update SkCanvas' experimental SkiaRenderer API"" > > This reverts commit bd9d88a6e4d9730f3aa67227e5a1618180513a87. > > Reason for revert: Breaks SkiaRenderer on Android. Rendering is all corrupted, bisected to this change. > > Original change's description: > > Reland "Update SkCanvas' experimental SkiaRenderer API" > > > > This reverts commit 90791c202dd2d943565237bf511d929e8bd19951. > > > > Reason for revert: Jumped the gun, just need to update blacklist > > > > Original change's description: > > > Revert "Update SkCanvas' experimental SkiaRenderer API" > > > > > > This reverts commit 4bf964602ab8758f6e580aaaa69add4fb260c1a6. > > > > > > Reason for revert: vulkan dm crashes > > > > > > Original change's description: > > > > Update SkCanvas' experimental SkiaRenderer API > > > > > > > > This lifts the temporary functions in SkGpuDevice into SkCanvas and > > > > deprecates the older experimental_DrawImageSetV1 and > > > > experimental_DrawEdgeAARect. The new functions can handle paints and > > > > transform batching. Internally, SkCanvas routes the old functions to the > > > > new entry points and all device-level code is updated to handle the new > > > > API features. > > > > > > > > While touching all of the canvas/device/recording areas, the > > > > experimental functions are grouped in an "EdgeAA" cluster instead of being > > > > separated into the image category and the rectangle category. > > > > > > > > Bug: skia:8739 > > > > Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b > > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221 > > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > > > > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > > > > > Change-Id: I87a5a258c5a1bd15e16389cdf91743772d6fa98a > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Bug: skia:8739 > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201226 > > > Reviewed-by: Michael Ludwig <michaelludwig@google.com> > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > > > Change-Id: I75e9b6cbf079a7739b69a7e208730a930621abf9 > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: skia:8739 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201229 > > Reviewed-by: Michael Ludwig <michaelludwig@google.com> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > Auto-Submit: Michael Ludwig <michaelludwig@google.com> > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > Change-Id: Ib87ef9b8b8598c16a8a6915920adf0b5dffc644b > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:8739 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201391 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> Bug: skia:8739, oss-fuzz:13794 Change-Id: Ibd7df4a398928c3170d16300bf3ade496125372c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201650 Commit-Queue: Michael Ludwig <michaelludwig@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-19 13:16:38 +00:00
using INHERITED = DrawCommand;
Reland "Reland "Update SkCanvas' experimental SkiaRenderer API"" This reverts commit 138a06d1b1cd035daf6b6a970c75126e94777822. Reason for revert: add explicit constructors to ImageSetEntry to account for the new arguments, matching SkiaRenderer's current initializer list. Also hardens SkPictureDrawback's deserialization code for drawEdgeAAImageSet and drawEdgeAAQuad from a fuzz that was found during the CL's brief lifespan. Original change's description: > Revert "Reland "Update SkCanvas' experimental SkiaRenderer API"" > > This reverts commit bd9d88a6e4d9730f3aa67227e5a1618180513a87. > > Reason for revert: Breaks SkiaRenderer on Android. Rendering is all corrupted, bisected to this change. > > Original change's description: > > Reland "Update SkCanvas' experimental SkiaRenderer API" > > > > This reverts commit 90791c202dd2d943565237bf511d929e8bd19951. > > > > Reason for revert: Jumped the gun, just need to update blacklist > > > > Original change's description: > > > Revert "Update SkCanvas' experimental SkiaRenderer API" > > > > > > This reverts commit 4bf964602ab8758f6e580aaaa69add4fb260c1a6. > > > > > > Reason for revert: vulkan dm crashes > > > > > > Original change's description: > > > > Update SkCanvas' experimental SkiaRenderer API > > > > > > > > This lifts the temporary functions in SkGpuDevice into SkCanvas and > > > > deprecates the older experimental_DrawImageSetV1 and > > > > experimental_DrawEdgeAARect. The new functions can handle paints and > > > > transform batching. Internally, SkCanvas routes the old functions to the > > > > new entry points and all device-level code is updated to handle the new > > > > API features. > > > > > > > > While touching all of the canvas/device/recording areas, the > > > > experimental functions are grouped in an "EdgeAA" cluster instead of being > > > > separated into the image category and the rectangle category. > > > > > > > > Bug: skia:8739 > > > > Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b > > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221 > > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > > > > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > > > > > Change-Id: I87a5a258c5a1bd15e16389cdf91743772d6fa98a > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Bug: skia:8739 > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201226 > > > Reviewed-by: Michael Ludwig <michaelludwig@google.com> > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > > > Change-Id: I75e9b6cbf079a7739b69a7e208730a930621abf9 > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: skia:8739 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201229 > > Reviewed-by: Michael Ludwig <michaelludwig@google.com> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com> > > Auto-Submit: Michael Ludwig <michaelludwig@google.com> > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com > > Change-Id: Ib87ef9b8b8598c16a8a6915920adf0b5dffc644b > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:8739 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201391 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> Bug: skia:8739, oss-fuzz:13794 Change-Id: Ibd7df4a398928c3170d16300bf3ade496125372c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201650 Commit-Queue: Michael Ludwig <michaelludwig@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-19 13:16:38 +00:00
};
#endif