skia2/include/gpu/GrClipData.h
commit-bot@chromium.org e3beb6bd7d SkNonCopyable should be used with private inheritance.
This is mostly s/public SkNoncopyable/SkNoncopyable/g.

Two classes (SkDrawLooper::Context and SkPicture::OperationList) don't actually work with SkNoncopyable because they introduce a virtual destructor.  I added SkNoncopyableVirtual to make them work as intended.  Sort of questionable whether they really need to be noncopyable in the first place, but I guess it doesn't hurt to keep the behavior the same.

BUG=skia:
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/226183018

git-svn-id: http://skia.googlecode.com/svn/trunk@14081 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-07 19:34:38 +00:00

62 lines
1.7 KiB
C++

/*
* Copyright 2010 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef GrClip_DEFINED
#define GrClip_DEFINED
#include "SkClipStack.h"
#include "GrSurface.h"
struct SkIRect;
/**
* GrClipData encapsulates the information required to construct the clip
* masks. 'fOrigin' is only non-zero when saveLayer has been called
* with an offset bounding box. The clips in 'fClipStack' are in
* device coordinates (i.e., they have been translated by -fOrigin w.r.t.
* the canvas' device coordinates).
*/
class GrClipData : SkNoncopyable {
public:
const SkClipStack* fClipStack;
SkIPoint fOrigin;
GrClipData()
: fClipStack(NULL) {
fOrigin.setZero();
}
bool operator==(const GrClipData& other) const {
if (fOrigin != other.fOrigin) {
return false;
}
if (NULL != fClipStack && NULL != other.fClipStack) {
return *fClipStack == *other.fClipStack;
}
return fClipStack == other.fClipStack;
}
bool operator!=(const GrClipData& other) const {
return !(*this == other);
}
void getConservativeBounds(const GrSurface* surface,
SkIRect* devResult,
bool* isIntersectionOfRects = NULL) const {
this->getConservativeBounds(surface->width(), surface->height(),
devResult, isIntersectionOfRects);
}
void getConservativeBounds(int width, int height,
SkIRect* devResult,
bool* isIntersectionOfRects = NULL) const;
};
#endif