michael@0: /* michael@0: * Copyright 2010 Google Inc. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: #include "GrClipData.h" michael@0: michael@0: #include "GrSurface.h" michael@0: #include "SkRect.h" michael@0: michael@0: /////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: /** michael@0: * getConservativeBounds returns the conservative bounding box of the clip michael@0: * in device (as opposed to canvas) coordinates. If the bounding box is michael@0: * the result of purely intersections of rects (with an initial replace) michael@0: * isIntersectionOfRects will be set to true. michael@0: */ michael@0: void GrClipData::getConservativeBounds(const GrSurface* surface, michael@0: SkIRect* devResult, michael@0: bool* isIntersectionOfRects) const { michael@0: SkRect devBounds; michael@0: michael@0: fClipStack->getConservativeBounds(-fOrigin.fX, michael@0: -fOrigin.fY, michael@0: surface->width(), michael@0: surface->height(), michael@0: &devBounds, michael@0: isIntersectionOfRects); michael@0: michael@0: devBounds.roundOut(devResult); michael@0: }