skia2/include/gpu/GrClipData.h
rmistry@google.com fbfcd56021 Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/)
This CL is part I of IV (I broke down the 1280 files into 4 CLs).
Review URL: https://codereview.appspot.com/6485054

git-svn-id: http://skia.googlecode.com/svn/trunk@5262 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-08-23 18:09:54 +00:00

59 lines
1.3 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 "GrRect.h"
#include "SkClipStack.h"
class GrSurface;
/**
* 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 : public 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,
GrIRect* devResult,
bool* isIntersectionOfRects = NULL) const;
};
#endif