Revert of remove guarded code - there are no more callers (https://codereview.chromium.org/343783002/)

Reason for revert:
webkit still uses getTotalClip -- need to find where they define the guard.

../../skia/ext/skia_utils_mac.mm:400:42: error: no member named 'getTotalClip' in 'SkCanvas'
      const SkRegion& clipRgn = canvas_->getTotalClip();
                                ~~~~~~~  ^

Original issue's description:
> remove guarded code - there are no more callers
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/c5d5cf9489977aa6fba077d1dc242029fbb4859e

R=scroggo@google.com, reed@google.com
TBR=reed@google.com, scroggo@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/342843002
This commit is contained in:
reed 2014-06-18 15:51:20 -07:00 committed by Commit bot
parent ffa9b500d7
commit 9f0147143f
5 changed files with 59 additions and 5 deletions

View File

@ -1111,6 +1111,15 @@ public:
virtual ClipType getClipType() const;
#endif
#ifdef SK_SUPPORT_LEGACY_GETTOTALCLIP
/** DEPRECATED -- need to move this guy to private/friend
* Return the current device clip (concatenation of all clip calls).
* This does not account for the translate in any of the devices.
* @return the current device clip (concatenation of all clip calls).
*/
const SkRegion& getTotalClip() const;
#endif
/** Return the clip stack. The clip stack stores all the individual
* clips organized by the save/restore frame in which they were
* added.

View File

@ -1,3 +1,4 @@
/*
* Copyright 2006 The Android Open Source Project
*
@ -5,6 +6,7 @@
* found in the LICENSE file.
*/
#ifndef SkLayerRasterizer_DEFINED
#define SkLayerRasterizer_DEFINED
@ -62,9 +64,24 @@ public:
SkDeque* fLayers;
};
#ifdef SK_SUPPORT_LEGACY_LAYERRASTERIZER_API
void addLayer(const SkPaint& paint) {
this->addLayer(paint, 0, 0);
}
/** Add a new layer (above any previous layers) to the rasterizer.
The layer will extract those fields that affect the mask from
the specified paint, but will not retain a reference to the paint
object itself, so it may be reused without danger of side-effects.
*/
void addLayer(const SkPaint& paint, SkScalar dx, SkScalar dy);
#endif
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLayerRasterizer)
protected:
SkLayerRasterizer(SkDeque* layers);
SkLayerRasterizer(SkReadBuffer&);
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
// override from SkRasterizer
@ -72,12 +89,17 @@ protected:
const SkIRect* clipBounds,
SkMask* mask, SkMask::CreateMode mode) const;
private:
const SkDeque* const fLayers;
#ifdef SK_SUPPORT_LEGACY_LAYERRASTERIZER_API
public:
#endif
SkLayerRasterizer();
SkLayerRasterizer(SkDeque* layers);
SkLayerRasterizer(SkReadBuffer&);
private:
#ifdef SK_SUPPORT_LEGACY_LAYERRASTERIZER_API
SkDeque* fLayers;
#else
const SkDeque* const fLayers;
#endif
static SkDeque* ReadLayers(SkReadBuffer& buffer);

View File

@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
#include "SkCanvas.h"
#include "SkBitmapDevice.h"
#include "SkDeviceImageFilterProxy.h"
@ -1772,6 +1773,12 @@ SkCanvas::ClipType SkCanvas::getClipType() const {
}
#endif
#ifdef SK_SUPPORT_LEGACY_GETTOTALCLIP
const SkRegion& SkCanvas::getTotalClip() const {
return fMCRec->fRasterClip->forceGetBW();
}
#endif
const SkRegion& SkCanvas::internal_private_getTotalClip() const {
return fMCRec->fRasterClip->forceGetBW();
}

View File

@ -88,6 +88,9 @@ bool NeedsDeepCopy(const SkPaint& paint) {
return false
#ifdef SK_SUPPORT_LEGACY_SHADER_LOCALMATRIX
|| paint.getShader()
#endif
#ifdef SK_SUPPORT_LEGACY_LAYERRASTERIZER_API
|| paint.getRasterizer()
#endif
|| paint.getImageFilter()
;

View File

@ -1,3 +1,4 @@
/*
* Copyright 2006 The Android Open Source Project
*
@ -5,6 +6,7 @@
* found in the LICENSE file.
*/
#include "SkLayerRasterizer.h"
#include "SkDraw.h"
#include "SkReadBuffer.h"
@ -48,6 +50,17 @@ SkLayerRasterizer::~SkLayerRasterizer() {
clean_up_layers(const_cast<SkDeque*>(fLayers));
}
#ifdef SK_SUPPORT_LEGACY_LAYERRASTERIZER_API
void SkLayerRasterizer::addLayer(const SkPaint& paint, SkScalar dx,
SkScalar dy) {
SkASSERT(fLayers);
SkLayerRasterizer_Rec* rec = (SkLayerRasterizer_Rec*)fLayers->push_back();
SkNEW_PLACEMENT_ARGS(&rec->fPaint, SkPaint, (paint));
rec->fOffset.set(dx, dy);
}
#endif
static bool compute_bounds(const SkDeque& layers, const SkPath& path,
const SkMatrix& matrix,
const SkIRect* clipBounds, SkIRect* bounds) {