2012-06-29 14:21:22 +00:00
|
|
|
/*
|
|
|
|
* 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_
|
|
|
|
|
2017-05-03 19:16:58 +00:00
|
|
|
#include "SkBitmap.h"
|
2012-06-29 14:21:22 +00:00
|
|
|
#include "SkCanvas.h"
|
2018-04-12 16:45:58 +00:00
|
|
|
#include "SkDrawShadowInfo.h"
|
2017-07-18 14:53:11 +00:00
|
|
|
#include "SkFlattenable.h"
|
2019-01-28 18:41:19 +00:00
|
|
|
#include "SkJSONWriter.h"
|
2015-08-05 20:57:49 +00:00
|
|
|
#include "SkTLazy.h"
|
|
|
|
#include "SkPath.h"
|
2017-02-13 14:32:54 +00:00
|
|
|
#include "SkRegion.h"
|
2015-08-05 20:57:49 +00:00
|
|
|
#include "SkRRect.h"
|
2016-07-07 19:47:17 +00:00
|
|
|
#include "SkRSXform.h"
|
2013-05-29 13:24:23 +00:00
|
|
|
#include "SkString.h"
|
2015-08-05 20:57:49 +00:00
|
|
|
#include "SkTDArray.h"
|
2017-03-17 16:09:04 +00:00
|
|
|
#include "SkVertices.h"
|
2016-02-11 18:35:21 +00:00
|
|
|
#include "UrlDataManager.h"
|
2012-06-29 14:21:22 +00:00
|
|
|
|
2016-10-11 20:26:57 +00:00
|
|
|
class SkDrawCommand {
|
2012-06-29 14:21:22 +00:00
|
|
|
public:
|
2015-02-13 19:13:00 +00:00
|
|
|
enum OpType {
|
2015-04-02 03:58:37 +00:00
|
|
|
kBeginDrawPicture_OpType,
|
2018-03-12 14:57:28 +00:00
|
|
|
kClear_OpType,
|
2015-02-13 19:13:00 +00:00
|
|
|
kClipPath_OpType,
|
|
|
|
kClipRegion_OpType,
|
|
|
|
kClipRect_OpType,
|
|
|
|
kClipRRect_OpType,
|
|
|
|
kConcat_OpType,
|
2016-06-29 01:54:19 +00:00
|
|
|
kDrawAnnotation_OpType,
|
2015-02-13 19:13:00 +00:00
|
|
|
kDrawBitmap_OpType,
|
2018-05-18 20:59:13 +00:00
|
|
|
kDrawBitmapLattice_OpType,
|
2015-02-13 19:13:00 +00:00
|
|
|
kDrawBitmapNine_OpType,
|
|
|
|
kDrawBitmapRect_OpType,
|
|
|
|
kDrawDRRect_OpType,
|
2015-07-22 17:23:01 +00:00
|
|
|
kDrawImage_OpType,
|
2017-01-12 21:20:50 +00:00
|
|
|
kDrawImageLattice_OpType,
|
2018-03-12 14:57:28 +00:00
|
|
|
kDrawImageNine_OpType,
|
2015-07-22 17:23:01 +00:00
|
|
|
kDrawImageRect_OpType,
|
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>
2019-03-15 14:33:31 +00:00
|
|
|
kDrawImageSet_OpType,
|
2015-02-13 19:13:00 +00:00
|
|
|
kDrawOval_OpType,
|
2018-03-12 14:57:28 +00:00
|
|
|
kDrawArc_OpType,
|
2015-02-13 19:13:00 +00:00
|
|
|
kDrawPaint_OpType,
|
|
|
|
kDrawPatch_OpType,
|
|
|
|
kDrawPath_OpType,
|
|
|
|
kDrawPoints_OpType,
|
|
|
|
kDrawRect_OpType,
|
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>
2019-03-15 14:33:31 +00:00
|
|
|
kDrawEdgeAARect_OpType,
|
2015-02-13 19:13:00 +00:00
|
|
|
kDrawRRect_OpType,
|
2018-03-12 14:57:28 +00:00
|
|
|
kDrawRegion_OpType,
|
2018-04-12 16:45:58 +00:00
|
|
|
kDrawShadow_OpType,
|
2015-02-13 19:13:00 +00:00
|
|
|
kDrawTextBlob_OpType,
|
|
|
|
kDrawVertices_OpType,
|
2018-05-29 15:23:35 +00:00
|
|
|
kDrawAtlas_OpType,
|
2018-05-29 18:55:50 +00:00
|
|
|
kDrawDrawable_OpType,
|
2015-04-02 03:58:37 +00:00
|
|
|
kEndDrawPicture_OpType,
|
2015-02-13 19:13:00 +00:00
|
|
|
kRestore_OpType,
|
|
|
|
kSave_OpType,
|
|
|
|
kSaveLayer_OpType,
|
|
|
|
kSetMatrix_OpType,
|
|
|
|
|
2017-05-02 20:49:24 +00:00
|
|
|
kLast_OpType = kSetMatrix_OpType
|
2015-02-13 19:13:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const int kOpTypeCount = kLast_OpType + 1;
|
2015-02-12 14:37:12 +00:00
|
|
|
|
2018-08-08 21:03:39 +00:00
|
|
|
static void WritePNG(SkBitmap bitmap, SkWStream& out);
|
2016-03-21 17:19:39 +00:00
|
|
|
|
2015-02-13 19:13:00 +00:00
|
|
|
SkDrawCommand(OpType opType);
|
2012-06-29 14:21:22 +00:00
|
|
|
|
2018-04-06 18:51:42 +00:00
|
|
|
virtual ~SkDrawCommand() {}
|
2012-06-29 14:21:22 +00:00
|
|
|
|
2012-07-31 19:55:32 +00:00
|
|
|
bool isVisible() const {
|
|
|
|
return fVisible;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setVisible(bool toggle) {
|
|
|
|
fVisible = toggle;
|
|
|
|
}
|
2012-06-29 14:21:22 +00:00
|
|
|
|
2014-11-09 00:18:56 +00:00
|
|
|
virtual void execute(SkCanvas*) const = 0;
|
2012-06-29 14:21:22 +00:00
|
|
|
|
2013-06-06 23:59:28 +00:00
|
|
|
virtual bool render(SkCanvas* canvas) const { return false; }
|
2012-11-21 17:11:02 +00:00
|
|
|
|
2019-01-28 18:41:19 +00:00
|
|
|
virtual void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const;
|
2016-02-10 13:40:46 +00:00
|
|
|
|
2015-02-13 19:13:00 +00:00
|
|
|
static const char* GetCommandString(OpType type);
|
2012-11-19 20:44:29 +00:00
|
|
|
|
2016-03-03 19:39:38 +00:00
|
|
|
// Helper methods for converting things to JSON
|
2019-01-28 18:41:19 +00:00
|
|
|
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 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,
|
2016-05-04 18:06:28 +00:00
|
|
|
UrlDataManager& urlDataManager);
|
2019-01-28 18:41:19 +00:00
|
|
|
static bool flatten(const SkImage& image, SkJSONWriter& writer,
|
2016-05-04 18:06:28 +00:00
|
|
|
UrlDataManager& urlDataManager);
|
2019-01-28 18:41:19 +00:00
|
|
|
static bool flatten(const SkBitmap& bitmap, SkJSONWriter& writer,
|
2016-05-04 18:06:28 +00:00
|
|
|
UrlDataManager& urlDataManager);
|
2016-03-03 19:39:38 +00:00
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
private:
|
2015-02-13 19:13:00 +00:00
|
|
|
OpType fOpType;
|
2014-03-25 23:31:33 +00:00
|
|
|
bool fVisible;
|
2012-06-29 14:21:22 +00:00
|
|
|
};
|
|
|
|
|
2013-06-18 20:20:55 +00:00
|
|
|
class SkRestoreCommand : public SkDrawCommand {
|
2012-06-29 14:21:22 +00:00
|
|
|
public:
|
2013-06-18 20:20:55 +00:00
|
|
|
SkRestoreCommand();
|
2015-03-26 01:17:31 +00:00
|
|
|
void execute(SkCanvas* canvas) const override;
|
2013-03-22 16:33:31 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
typedef SkDrawCommand INHERITED;
|
2012-06-29 14:21:22 +00:00
|
|
|
};
|
|
|
|
|
2013-06-18 20:20:55 +00:00
|
|
|
class SkClearCommand : public SkDrawCommand {
|
2012-06-29 14:21:22 +00:00
|
|
|
public:
|
2013-06-18 20:20:55 +00:00
|
|
|
SkClearCommand(SkColor color);
|
2015-03-26 01:17:31 +00:00
|
|
|
void execute(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2016-02-10 13:40:46 +00:00
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
private:
|
|
|
|
SkColor fColor;
|
2013-03-22 16:33:31 +00:00
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
2012-06-29 14:21:22 +00:00
|
|
|
};
|
|
|
|
|
2013-06-18 20:20:55 +00:00
|
|
|
class SkClipPathCommand : public SkDrawCommand {
|
2012-06-29 14:21:22 +00:00
|
|
|
public:
|
2016-12-09 14:00:50 +00:00
|
|
|
SkClipPathCommand(const SkPath& path, SkClipOp op, bool doAA);
|
2015-03-26 01:17:31 +00:00
|
|
|
void execute(SkCanvas* canvas) const override;
|
|
|
|
bool render(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2016-02-10 13:40:46 +00:00
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
private:
|
2016-12-09 14:00:50 +00:00
|
|
|
SkPath fPath;
|
|
|
|
SkClipOp fOp;
|
|
|
|
bool fDoAA;
|
2013-03-17 18:33:46 +00:00
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
2012-06-29 14:21:22 +00:00
|
|
|
};
|
|
|
|
|
2013-06-18 20:20:55 +00:00
|
|
|
class SkClipRegionCommand : public SkDrawCommand {
|
2012-06-29 14:21:22 +00:00
|
|
|
public:
|
2016-12-09 14:00:50 +00:00
|
|
|
SkClipRegionCommand(const SkRegion& region, SkClipOp op);
|
2015-03-26 01:17:31 +00:00
|
|
|
void execute(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2016-02-10 13:40:46 +00:00
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
private:
|
2016-12-09 14:00:50 +00:00
|
|
|
SkRegion fRegion;
|
|
|
|
SkClipOp fOp;
|
2013-03-22 16:33:31 +00:00
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
2012-06-29 14:21:22 +00:00
|
|
|
};
|
|
|
|
|
2013-06-18 20:20:55 +00:00
|
|
|
class SkClipRectCommand : public SkDrawCommand {
|
2012-06-29 14:21:22 +00:00
|
|
|
public:
|
2016-12-09 14:00:50 +00:00
|
|
|
SkClipRectCommand(const SkRect& rect, SkClipOp op, bool doAA);
|
2015-03-26 01:17:31 +00:00
|
|
|
void execute(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2013-03-11 22:53:11 +00:00
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
private:
|
2016-12-09 14:00:50 +00:00
|
|
|
SkRect fRect;
|
|
|
|
SkClipOp fOp;
|
|
|
|
bool fDoAA;
|
2013-03-22 12:25:30 +00:00
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
2012-06-29 14:21:22 +00:00
|
|
|
};
|
|
|
|
|
2013-06-18 20:20:55 +00:00
|
|
|
class SkClipRRectCommand : public SkDrawCommand {
|
2013-01-02 20:20:31 +00:00
|
|
|
public:
|
2016-12-09 14:00:50 +00:00
|
|
|
SkClipRRectCommand(const SkRRect& rrect, SkClipOp op, bool doAA);
|
2015-03-26 01:17:31 +00:00
|
|
|
void execute(SkCanvas* canvas) const override;
|
|
|
|
bool render(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2013-03-11 22:53:11 +00:00
|
|
|
|
2013-01-02 20:20:31 +00:00
|
|
|
private:
|
2016-12-09 14:00:50 +00:00
|
|
|
SkRRect fRRect;
|
|
|
|
SkClipOp fOp;
|
|
|
|
bool fDoAA;
|
2013-03-22 12:25:30 +00:00
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
2013-01-02 20:20:31 +00:00
|
|
|
};
|
|
|
|
|
2013-06-18 20:20:55 +00:00
|
|
|
class SkConcatCommand : public SkDrawCommand {
|
2012-06-29 14:21:22 +00:00
|
|
|
public:
|
2013-06-18 20:20:55 +00:00
|
|
|
SkConcatCommand(const SkMatrix& matrix);
|
2015-03-26 01:17:31 +00:00
|
|
|
void execute(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2016-02-10 13:40:46 +00:00
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
private:
|
2013-03-22 16:33:31 +00:00
|
|
|
SkMatrix fMatrix;
|
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
2012-06-29 14:21:22 +00:00
|
|
|
};
|
|
|
|
|
2016-06-29 01:54:19 +00:00
|
|
|
class SkDrawAnnotationCommand : public SkDrawCommand {
|
|
|
|
public:
|
|
|
|
SkDrawAnnotationCommand(const SkRect&, const char key[], sk_sp<SkData> value);
|
|
|
|
void execute(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2016-06-29 01:54:19 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
SkRect fRect;
|
|
|
|
SkString fKey;
|
|
|
|
sk_sp<SkData> fValue;
|
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
|
|
|
};
|
|
|
|
|
2013-06-18 20:20:55 +00:00
|
|
|
class SkDrawBitmapCommand : public SkDrawCommand {
|
2012-06-29 14:21:22 +00:00
|
|
|
public:
|
2013-06-18 20:20:55 +00:00
|
|
|
SkDrawBitmapCommand(const SkBitmap& bitmap, SkScalar left, SkScalar top,
|
2014-03-25 23:31:33 +00:00
|
|
|
const SkPaint* paint);
|
2015-03-26 01:17:31 +00:00
|
|
|
void execute(SkCanvas* canvas) const override;
|
|
|
|
bool render(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2016-02-10 13:40:46 +00:00
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
private:
|
2018-05-29 17:38:07 +00:00
|
|
|
SkBitmap fBitmap;
|
|
|
|
SkScalar fLeft;
|
|
|
|
SkScalar fTop;
|
|
|
|
SkTLazy<SkPaint> fPaint;
|
2013-03-22 16:33:31 +00:00
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
2012-06-29 14:21:22 +00:00
|
|
|
};
|
|
|
|
|
2018-05-18 20:59:13 +00:00
|
|
|
class SkDrawBitmapLatticeCommand : public SkDrawCommand {
|
|
|
|
public:
|
|
|
|
SkDrawBitmapLatticeCommand(const SkBitmap& bitmap, const SkCanvas::Lattice& lattice,
|
|
|
|
const SkRect& dst, const SkPaint* paint);
|
|
|
|
void execute(SkCanvas* canvas) const override;
|
|
|
|
bool render(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2018-05-18 20:59:13 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
SkBitmap fBitmap;
|
|
|
|
SkCanvas::Lattice fLattice;
|
|
|
|
SkRect fDst;
|
|
|
|
SkTLazy<SkPaint> fPaint;
|
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
|
|
|
};
|
|
|
|
|
2013-06-18 20:20:55 +00:00
|
|
|
class SkDrawBitmapNineCommand : public SkDrawCommand {
|
2012-06-29 14:21:22 +00:00
|
|
|
public:
|
2013-06-18 20:20:55 +00:00
|
|
|
SkDrawBitmapNineCommand(const SkBitmap& bitmap, const SkIRect& center,
|
2014-03-25 23:31:33 +00:00
|
|
|
const SkRect& dst, const SkPaint* paint);
|
2015-03-26 01:17:31 +00:00
|
|
|
void execute(SkCanvas* canvas) const override;
|
|
|
|
bool render(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2016-02-10 13:40:46 +00:00
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
private:
|
2018-05-29 17:38:07 +00:00
|
|
|
SkBitmap fBitmap;
|
|
|
|
SkIRect fCenter;
|
|
|
|
SkRect fDst;
|
|
|
|
SkTLazy<SkPaint> fPaint;
|
2013-03-22 16:33:31 +00:00
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
2012-06-29 14:21:22 +00:00
|
|
|
};
|
|
|
|
|
2013-06-18 20:20:55 +00:00
|
|
|
class SkDrawBitmapRectCommand : public SkDrawCommand {
|
2012-06-29 14:21:22 +00:00
|
|
|
public:
|
2013-06-18 20:20:55 +00:00
|
|
|
SkDrawBitmapRectCommand(const SkBitmap& bitmap, const SkRect* src,
|
2013-08-16 10:24:37 +00:00
|
|
|
const SkRect& dst, const SkPaint* paint,
|
2015-07-14 17:54:12 +00:00
|
|
|
SkCanvas::SrcRectConstraint);
|
2015-03-26 01:17:31 +00:00
|
|
|
void execute(SkCanvas* canvas) const override;
|
|
|
|
bool render(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2013-08-16 10:24:37 +00:00
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
private:
|
2013-08-16 10:24:37 +00:00
|
|
|
SkBitmap fBitmap;
|
2018-05-29 17:38:07 +00:00
|
|
|
SkTLazy<SkRect> fSrc;
|
2013-08-16 10:24:37 +00:00
|
|
|
SkRect fDst;
|
2018-05-29 17:38:07 +00:00
|
|
|
SkTLazy<SkPaint> fPaint;
|
2015-07-14 17:54:12 +00:00
|
|
|
SkCanvas::SrcRectConstraint fConstraint;
|
2013-03-17 18:33:46 +00:00
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
2012-06-29 14:21:22 +00:00
|
|
|
};
|
|
|
|
|
2015-07-22 17:23:01 +00:00
|
|
|
class SkDrawImageCommand : public SkDrawCommand {
|
|
|
|
public:
|
|
|
|
SkDrawImageCommand(const SkImage* image, SkScalar left, SkScalar top, const SkPaint* paint);
|
|
|
|
void execute(SkCanvas* canvas) const override;
|
|
|
|
bool render(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2016-02-10 13:40:46 +00:00
|
|
|
|
2015-07-22 17:23:01 +00:00
|
|
|
private:
|
2016-11-03 20:26:13 +00:00
|
|
|
sk_sp<const SkImage> fImage;
|
|
|
|
SkScalar fLeft;
|
|
|
|
SkScalar fTop;
|
|
|
|
SkTLazy<SkPaint> fPaint;
|
2015-07-22 17:23:01 +00:00
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
|
|
|
};
|
|
|
|
|
2017-01-12 21:20:50 +00:00
|
|
|
class SkDrawImageLatticeCommand : public SkDrawCommand {
|
|
|
|
public:
|
|
|
|
SkDrawImageLatticeCommand(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;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2017-01-12 21:20:50 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
sk_sp<const SkImage> fImage;
|
|
|
|
SkCanvas::Lattice fLattice;
|
|
|
|
SkRect fDst;
|
|
|
|
SkTLazy<SkPaint> fPaint;
|
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
|
|
|
};
|
|
|
|
|
2018-03-12 14:57:28 +00:00
|
|
|
class SkDrawImageNineCommand : public SkDrawCommand {
|
|
|
|
public:
|
|
|
|
SkDrawImageNineCommand(const SkImage* image, const SkIRect& center,
|
|
|
|
const SkRect& dst, const SkPaint* paint);
|
|
|
|
void execute(SkCanvas* canvas) const override;
|
|
|
|
bool render(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2018-03-12 14:57:28 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
sk_sp<const SkImage> fImage;
|
|
|
|
SkIRect fCenter;
|
|
|
|
SkRect fDst;
|
2018-05-29 17:38:07 +00:00
|
|
|
SkTLazy<SkPaint> fPaint;
|
2018-03-12 14:57:28 +00:00
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
|
|
|
};
|
|
|
|
|
2015-07-22 17:23:01 +00:00
|
|
|
class SkDrawImageRectCommand : public SkDrawCommand {
|
|
|
|
public:
|
|
|
|
SkDrawImageRectCommand(const SkImage* image, const SkRect* src, const SkRect& dst,
|
|
|
|
const SkPaint* paint, SkCanvas::SrcRectConstraint constraint);
|
|
|
|
void execute(SkCanvas* canvas) const override;
|
|
|
|
bool render(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2016-02-10 13:40:46 +00:00
|
|
|
|
2015-07-22 17:23:01 +00:00
|
|
|
private:
|
2016-11-03 20:26:13 +00:00
|
|
|
sk_sp<const SkImage> fImage;
|
2015-07-22 17:23:01 +00:00
|
|
|
SkTLazy<SkRect> fSrc;
|
|
|
|
SkRect fDst;
|
|
|
|
SkTLazy<SkPaint> fPaint;
|
|
|
|
SkCanvas::SrcRectConstraint fConstraint;
|
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
|
|
|
};
|
|
|
|
|
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>
2019-03-15 14:33:31 +00:00
|
|
|
class SkDrawImageSetCommand : public SkDrawCommand {
|
|
|
|
public:
|
|
|
|
SkDrawImageSetCommand(const SkCanvas::ImageSetEntry[], int count, SkFilterQuality, SkBlendMode);
|
|
|
|
void execute(SkCanvas* canvas) const override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
SkAutoTArray<SkCanvas::ImageSetEntry> fSet;
|
|
|
|
int fCount;
|
|
|
|
SkFilterQuality fFilterQuality;
|
|
|
|
SkBlendMode fMode;
|
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
|
|
|
};
|
|
|
|
|
2013-06-18 20:20:55 +00:00
|
|
|
class SkDrawOvalCommand : public SkDrawCommand {
|
2013-01-02 20:20:31 +00:00
|
|
|
public:
|
2013-06-18 20:20:55 +00:00
|
|
|
SkDrawOvalCommand(const SkRect& oval, const SkPaint& paint);
|
2015-03-26 01:17:31 +00:00
|
|
|
void execute(SkCanvas* canvas) const override;
|
|
|
|
bool render(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2016-02-10 13:40:46 +00:00
|
|
|
|
2013-01-02 20:20:31 +00:00
|
|
|
private:
|
2013-03-22 12:25:30 +00:00
|
|
|
SkRect fOval;
|
|
|
|
SkPaint fPaint;
|
|
|
|
|
2016-08-19 18:25:19 +00:00
|
|
|
typedef SkDrawCommand INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
class SkDrawArcCommand : public SkDrawCommand {
|
|
|
|
public:
|
|
|
|
SkDrawArcCommand(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, bool useCenter,
|
|
|
|
const SkPaint& paint);
|
|
|
|
void execute(SkCanvas* canvas) const override;
|
|
|
|
bool render(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2016-08-19 18:25:19 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
SkRect fOval;
|
|
|
|
SkScalar fStartAngle;
|
|
|
|
SkScalar fSweepAngle;
|
|
|
|
bool fUseCenter;
|
|
|
|
SkPaint fPaint;
|
|
|
|
|
2013-03-22 12:25:30 +00:00
|
|
|
typedef SkDrawCommand INHERITED;
|
2013-01-02 20:20:31 +00:00
|
|
|
};
|
|
|
|
|
2013-06-18 20:20:55 +00:00
|
|
|
class SkDrawPaintCommand : public SkDrawCommand {
|
2012-06-29 14:21:22 +00:00
|
|
|
public:
|
2013-06-18 20:20:55 +00:00
|
|
|
SkDrawPaintCommand(const SkPaint& paint);
|
2015-03-26 01:17:31 +00:00
|
|
|
void execute(SkCanvas* canvas) const override;
|
|
|
|
bool render(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2016-02-10 13:40:46 +00:00
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
private:
|
2013-03-22 12:25:30 +00:00
|
|
|
SkPaint fPaint;
|
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
2012-06-29 14:21:22 +00:00
|
|
|
};
|
|
|
|
|
2013-06-18 20:20:55 +00:00
|
|
|
class SkDrawPathCommand : public SkDrawCommand {
|
2012-06-29 14:21:22 +00:00
|
|
|
public:
|
2013-06-18 20:20:55 +00:00
|
|
|
SkDrawPathCommand(const SkPath& path, const SkPaint& paint);
|
2015-03-26 01:17:31 +00:00
|
|
|
void execute(SkCanvas* canvas) const override;
|
|
|
|
bool render(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2012-11-21 17:11:02 +00:00
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
private:
|
2013-03-25 11:50:42 +00:00
|
|
|
SkPath fPath;
|
|
|
|
SkPaint fPaint;
|
2013-03-17 18:33:46 +00:00
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
2012-06-29 14:21:22 +00:00
|
|
|
};
|
|
|
|
|
2015-04-02 03:58:37 +00:00
|
|
|
class SkBeginDrawPictureCommand : public SkDrawCommand {
|
2012-06-29 14:21:22 +00:00
|
|
|
public:
|
2015-04-02 03:58:37 +00:00
|
|
|
SkBeginDrawPictureCommand(const SkPicture* picture,
|
|
|
|
const SkMatrix* matrix,
|
|
|
|
const SkPaint* paint);
|
|
|
|
|
2015-03-26 01:17:31 +00:00
|
|
|
void execute(SkCanvas* canvas) const override;
|
|
|
|
bool render(SkCanvas* canvas) const override;
|
2013-11-21 17:08:12 +00:00
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
private:
|
2016-11-03 20:26:13 +00:00
|
|
|
sk_sp<const SkPicture> fPicture;
|
|
|
|
SkTLazy<SkMatrix> fMatrix;
|
|
|
|
SkTLazy<SkPaint> fPaint;
|
2015-04-02 03:58:37 +00:00
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
class SkEndDrawPictureCommand : public SkDrawCommand {
|
|
|
|
public:
|
|
|
|
SkEndDrawPictureCommand(bool restore);
|
|
|
|
|
|
|
|
void execute(SkCanvas* canvas) const override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool fRestore;
|
2013-03-25 11:50:42 +00:00
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
2012-06-29 14:21:22 +00:00
|
|
|
};
|
|
|
|
|
2013-06-18 20:20:55 +00:00
|
|
|
class SkDrawPointsCommand : public SkDrawCommand {
|
2012-06-29 14:21:22 +00:00
|
|
|
public:
|
2013-06-18 20:20:55 +00:00
|
|
|
SkDrawPointsCommand(SkCanvas::PointMode mode, size_t count, const SkPoint pts[],
|
2014-03-25 23:31:33 +00:00
|
|
|
const SkPaint& paint);
|
2015-03-26 01:17:31 +00:00
|
|
|
void execute(SkCanvas* canvas) const override;
|
|
|
|
bool render(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2016-02-10 13:40:46 +00:00
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
private:
|
|
|
|
SkCanvas::PointMode fMode;
|
2018-05-29 17:38:07 +00:00
|
|
|
SkTDArray<SkPoint> fPts;
|
2013-03-22 12:25:30 +00:00
|
|
|
SkPaint fPaint;
|
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
2012-06-29 14:21:22 +00:00
|
|
|
};
|
|
|
|
|
2018-03-12 14:57:28 +00:00
|
|
|
class SkDrawRegionCommand : public SkDrawCommand {
|
|
|
|
public:
|
|
|
|
SkDrawRegionCommand(const SkRegion& region, const SkPaint& paint);
|
|
|
|
void execute(SkCanvas* canvas) const override;
|
|
|
|
bool render(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2018-03-12 14:57:28 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
SkRegion fRegion;
|
|
|
|
SkPaint fPaint;
|
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
|
|
|
};
|
|
|
|
|
2014-08-26 14:56:44 +00:00
|
|
|
class SkDrawTextBlobCommand : public SkDrawCommand {
|
|
|
|
public:
|
2016-09-13 17:00:23 +00:00
|
|
|
SkDrawTextBlobCommand(sk_sp<SkTextBlob> blob, SkScalar x, SkScalar y, const SkPaint& paint);
|
2014-08-26 14:56:44 +00:00
|
|
|
|
2015-03-26 01:17:31 +00:00
|
|
|
void execute(SkCanvas* canvas) const override;
|
|
|
|
bool render(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2014-08-26 14:56:44 +00:00
|
|
|
|
|
|
|
private:
|
2016-09-13 17:00:23 +00:00
|
|
|
sk_sp<SkTextBlob> fBlob;
|
|
|
|
SkScalar fXPos;
|
|
|
|
SkScalar fYPos;
|
|
|
|
SkPaint fPaint;
|
2014-08-26 14:56:44 +00:00
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
|
|
|
};
|
|
|
|
|
2015-02-13 19:13:00 +00:00
|
|
|
class SkDrawPatchCommand : public SkDrawCommand {
|
|
|
|
public:
|
|
|
|
SkDrawPatchCommand(const SkPoint cubics[12], const SkColor colors[4],
|
2016-10-28 19:42:34 +00:00
|
|
|
const SkPoint texCoords[4], SkBlendMode bmode,
|
2015-02-13 19:13:00 +00:00
|
|
|
const SkPaint& paint);
|
2015-03-26 01:17:31 +00:00
|
|
|
void execute(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2015-02-13 19:13:00 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
SkPoint fCubics[12];
|
2016-02-10 22:05:02 +00:00
|
|
|
SkColor* fColorsPtr;
|
|
|
|
SkColor fColors[4];
|
|
|
|
SkPoint* fTexCoordsPtr;
|
|
|
|
SkPoint fTexCoords[4];
|
2016-10-28 19:42:34 +00:00
|
|
|
SkBlendMode fBlendMode;
|
2015-02-13 19:13:00 +00:00
|
|
|
SkPaint fPaint;
|
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2013-06-18 20:20:55 +00:00
|
|
|
class SkDrawRectCommand : public SkDrawCommand {
|
2012-06-29 14:21:22 +00:00
|
|
|
public:
|
2013-06-18 20:20:55 +00:00
|
|
|
SkDrawRectCommand(const SkRect& rect, const SkPaint& paint);
|
2015-03-26 01:17:31 +00:00
|
|
|
void execute(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2013-03-11 22:53:11 +00:00
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
private:
|
2013-03-17 18:33:46 +00:00
|
|
|
SkRect fRect;
|
|
|
|
SkPaint fPaint;
|
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
2012-06-29 14:21:22 +00:00
|
|
|
};
|
|
|
|
|
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>
2019-03-15 14:33:31 +00:00
|
|
|
class SkDrawEdgeAARectCommand : public SkDrawCommand {
|
|
|
|
public:
|
|
|
|
SkDrawEdgeAARectCommand(const SkRect& rect, SkCanvas::QuadAAFlags aa, SkColor color,
|
|
|
|
SkBlendMode mode);
|
|
|
|
void execute(SkCanvas* canvas) const override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
SkRect fRect;
|
|
|
|
SkCanvas::QuadAAFlags fAA;
|
|
|
|
SkColor fColor;
|
|
|
|
SkBlendMode fMode;
|
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
|
|
|
};
|
|
|
|
|
2013-06-18 20:20:55 +00:00
|
|
|
class SkDrawRRectCommand : public SkDrawCommand {
|
2013-01-02 20:20:31 +00:00
|
|
|
public:
|
2013-06-18 20:20:55 +00:00
|
|
|
SkDrawRRectCommand(const SkRRect& rrect, const SkPaint& paint);
|
2015-03-26 01:17:31 +00:00
|
|
|
void execute(SkCanvas* canvas) const override;
|
|
|
|
bool render(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2016-02-10 13:40:46 +00:00
|
|
|
|
2013-01-02 20:20:31 +00:00
|
|
|
private:
|
|
|
|
SkRRect fRRect;
|
2013-03-11 22:53:11 +00:00
|
|
|
SkPaint fPaint;
|
2013-03-25 11:50:42 +00:00
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
2013-01-02 20:20:31 +00:00
|
|
|
};
|
|
|
|
|
2014-02-24 17:28:55 +00:00
|
|
|
class SkDrawDRRectCommand : public SkDrawCommand {
|
|
|
|
public:
|
|
|
|
SkDrawDRRectCommand(const SkRRect& outer, const SkRRect& inner,
|
|
|
|
const SkPaint& paint);
|
2015-03-26 01:17:31 +00:00
|
|
|
void execute(SkCanvas* canvas) const override;
|
|
|
|
bool render(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2016-02-10 13:40:46 +00:00
|
|
|
|
2014-02-24 17:28:55 +00:00
|
|
|
private:
|
|
|
|
SkRRect fOuter;
|
|
|
|
SkRRect fInner;
|
|
|
|
SkPaint fPaint;
|
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
|
|
|
};
|
|
|
|
|
2013-06-18 20:20:55 +00:00
|
|
|
class SkDrawVerticesCommand : public SkDrawCommand {
|
2012-06-29 14:21:22 +00:00
|
|
|
public:
|
2017-03-17 16:09:04 +00:00
|
|
|
SkDrawVerticesCommand(sk_sp<SkVertices>, SkBlendMode, const SkPaint&);
|
|
|
|
|
2015-03-26 01:17:31 +00:00
|
|
|
void execute(SkCanvas* canvas) const override;
|
2016-02-10 13:40:46 +00:00
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
private:
|
2017-03-17 16:09:04 +00:00
|
|
|
sk_sp<SkVertices> fVertices;
|
|
|
|
SkBlendMode fBlendMode;
|
|
|
|
SkPaint fPaint;
|
2013-03-25 11:50:42 +00:00
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
2012-06-29 14:21:22 +00:00
|
|
|
};
|
|
|
|
|
2018-05-29 15:23:35 +00:00
|
|
|
class SkDrawAtlasCommand : public SkDrawCommand {
|
|
|
|
public:
|
|
|
|
SkDrawAtlasCommand(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;
|
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
|
|
|
};
|
|
|
|
|
2013-06-18 20:20:55 +00:00
|
|
|
class SkSaveCommand : public SkDrawCommand {
|
2012-06-29 14:21:22 +00:00
|
|
|
public:
|
2014-06-30 14:13:28 +00:00
|
|
|
SkSaveCommand();
|
2015-03-26 01:17:31 +00:00
|
|
|
void execute(SkCanvas* canvas) const override;
|
2016-02-10 13:40:46 +00:00
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
private:
|
2013-03-22 16:33:31 +00:00
|
|
|
typedef SkDrawCommand INHERITED;
|
2012-06-29 14:21:22 +00:00
|
|
|
};
|
|
|
|
|
2013-06-18 20:20:55 +00:00
|
|
|
class SkSaveLayerCommand : public SkDrawCommand {
|
2012-06-29 14:21:22 +00:00
|
|
|
public:
|
2015-12-18 15:09:18 +00:00
|
|
|
SkSaveLayerCommand(const SkCanvas::SaveLayerRec&);
|
2015-03-26 01:17:31 +00:00
|
|
|
void execute(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2013-01-31 15:56:22 +00:00
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
private:
|
2018-05-29 17:38:07 +00:00
|
|
|
SkTLazy<SkRect> fBounds;
|
|
|
|
SkTLazy<SkPaint> fPaint;
|
|
|
|
sk_sp<const SkImageFilter> fBackdrop;
|
|
|
|
uint32_t fSaveLayerFlags;
|
2013-03-22 16:33:31 +00:00
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
2012-06-29 14:21:22 +00:00
|
|
|
};
|
|
|
|
|
2013-06-18 20:20:55 +00:00
|
|
|
class SkSetMatrixCommand : public SkDrawCommand {
|
2012-06-29 14:21:22 +00:00
|
|
|
public:
|
2013-06-18 20:20:55 +00:00
|
|
|
SkSetMatrixCommand(const SkMatrix& matrix);
|
2015-03-26 01:17:31 +00:00
|
|
|
void execute(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2016-02-10 13:40:46 +00:00
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
private:
|
2013-02-19 21:00:26 +00:00
|
|
|
SkMatrix fMatrix;
|
2013-03-25 11:50:42 +00:00
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
2012-06-29 14:21:22 +00:00
|
|
|
};
|
2018-04-12 16:45:58 +00:00
|
|
|
|
|
|
|
class SkDrawShadowCommand : public SkDrawCommand {
|
|
|
|
public:
|
|
|
|
SkDrawShadowCommand(const SkPath& path, const SkDrawShadowRec& rec);
|
|
|
|
void execute(SkCanvas* canvas) const override;
|
|
|
|
bool render(SkCanvas* canvas) const override;
|
2019-01-28 18:41:19 +00:00
|
|
|
void toJSON(SkJSONWriter& writer, UrlDataManager& urlDataManager) const override;
|
2018-04-12 16:45:58 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
SkPath fPath;
|
|
|
|
SkDrawShadowRec fShadowRec;
|
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
|
|
|
};
|
2016-08-25 13:30:23 +00:00
|
|
|
|
2018-05-29 18:55:50 +00:00
|
|
|
class SkDrawDrawableCommand : public SkDrawCommand {
|
|
|
|
public:
|
|
|
|
SkDrawDrawableCommand(SkDrawable*, const SkMatrix*);
|
|
|
|
void execute(SkCanvas* canvas) const override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
sk_sp<SkDrawable> fDrawable;
|
|
|
|
SkTLazy<SkMatrix> fMatrix;
|
|
|
|
|
|
|
|
typedef SkDrawCommand INHERITED;
|
|
|
|
};
|
|
|
|
#endif
|