2014-01-07 16:08:04 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2014 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SkNoSaveLayerCanvas_DEFINED
|
|
|
|
#define SkNoSaveLayerCanvas_DEFINED
|
|
|
|
|
|
|
|
#include "SkCanvas.h"
|
|
|
|
#include "SkRRect.h"
|
|
|
|
|
|
|
|
// The NoSaveLayerCanvas is used to play back SkPictures when the saveLayer
|
|
|
|
// functionality isn't required (e.g., during analysis of the draw calls).
|
|
|
|
// It also simplifies the clipping calls to only use rectangles.
|
2014-03-16 21:59:11 +00:00
|
|
|
class SK_API SkNoSaveLayerCanvas : public SkCanvas {
|
2014-01-07 16:08:04 +00:00
|
|
|
public:
|
2014-09-22 14:29:03 +00:00
|
|
|
SkNoSaveLayerCanvas(SkBaseDevice* device)
|
|
|
|
: INHERITED(device, NULL, kConservativeRasterClip_InitFlag)
|
Revert of Revert of allow canvas to force conservative clips (for speed) (patchset #1 id:1 of https://codereview.chromium.org/554033003/)
Reason for revert:
May just rebaseline, plus want to see the results of the chrome tests, so re-trying this CL.
Original issue's description:
> Revert of allow canvas to force conservative clips (for speed) (patchset #7 id:120001 of https://codereview.chromium.org/541593005/)
>
> Reason for revert:
> multipicturedraw failed on nvprmsaa -- don't know why yet
>
> Original issue's description:
> > Allow SkCanvas to be initialized to force conservative rasterclips. This has the following effects:
> >
> > 1. Queries to the current clip will be conservatively large. This can mean the quickReject may return false more often.
> >
> > 2. The conservative clips mean less work is done.
> >
> > 3. Enabled by default for Gpu, Record, and NoSaveLayer canvases.
> >
> > 4. API is private for now.
> >
> > Committed: https://skia.googlesource.com/skia/+/27a5e656c3d6ef22f9cb34de18e1b960da3aa241
>
> TBR=robertphillips@google.com,bsalomon@google.com,mtklein@google.com,junov@google.com
> NOTREECHECKS=true
> NOTRY=true
>
> Committed: https://skia.googlesource.com/skia/+/6f09709519b79a1159f3826645f1c5fbc101ee11
R=robertphillips@google.com, bsalomon@google.com, mtklein@google.com, junov@google.com, reed@google.com
TBR=bsalomon@google.com, junov@google.com, mtklein@google.com, reed@google.com, robertphillips@google.com
NOTREECHECKS=true
NOTRY=true
Author: reed@chromium.org
Review URL: https://codereview.chromium.org/560713002
2014-09-10 01:46:22 +00:00
|
|
|
{}
|
2014-01-07 16:08:04 +00:00
|
|
|
|
2014-03-12 20:21:48 +00:00
|
|
|
protected:
|
|
|
|
virtual SaveLayerStrategy willSaveLayer(const SkRect* bounds, const SkPaint* paint,
|
2015-03-26 01:17:31 +00:00
|
|
|
SaveFlags flags) override {
|
2014-03-12 20:21:48 +00:00
|
|
|
this->INHERITED::willSaveLayer(bounds, paint, flags);
|
|
|
|
return kNoLayer_SaveLayerStrategy;
|
2014-01-07 16:08:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
typedef SkCanvas INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SkNoSaveLayerCanvas_DEFINED
|