/* * 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 GrRect_DEFINED #define GrRect_DEFINED #include "include/core/SkMatrix.h" #include "include/core/SkRect.h" #include "include/core/SkTypes.h" /** Returns true if the rectangles have a nonzero area of overlap. It assumed that rects can be infinitely small but not "inverted". */ static inline bool GrRectsOverlap(const SkRect& a, const SkRect& b) { … } /** Returns true if the rectangles overlap or share an edge or corner. It assumed that rects can be infinitely small but not "inverted". */ static inline bool GrRectsTouchOrOverlap(const SkRect& a, const SkRect& b) { … } /** * Apply the transform from 'inRect' to 'outRect' to each point in 'inPts', storing the mapped point * into the parallel index of 'outPts'. */ static inline void GrMapRectPoints(const SkRect& inRect, const SkRect& outRect, const SkPoint inPts[], SkPoint outPts[], int ptCount) { … } /** * Clips the srcRect and the dstPoint to the bounds of the srcSize and dstSize respectively. Returns * true if the srcRect and dstRect intersect the srcRect and dst rect (dstPoint with srcRect * width/height). Returns false otherwise. The clipped values are stored back into 'dstPoint' * and 'srcRect' */ static inline bool GrClipSrcRectAndDstPoint(const SkISize& dstSize, SkIPoint* dstPoint, const SkISize& srcSize, SkIRect* srcRect) { … } #endif