Replace all instances of GrRect with SkRect.
And remove the typedef in GrRect.h. The same with GrIRect.
R=robertphillips@google.com
Author: tfarina@chromium.org
Review URL: https://chromiumcodereview.appspot.com/19449002
git-svn-id: http://skia.googlecode.com/svn/trunk@10130 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/texdata.cpp b/gm/texdata.cpp
index cfb27f6..612cc64 100644
--- a/gm/texdata.cpp
+++ b/gm/texdata.cpp
@@ -95,7 +95,7 @@
}
GrAutoUnref au(texture);
- GrContext::AutoClip acs(ctx, GrRect::MakeWH(2*S, 2*S));
+ GrContext::AutoClip acs(ctx, SkRect::MakeWH(2*S, 2*S));
ctx->setRenderTarget(target);
@@ -115,7 +115,7 @@
tm.postIDiv(2*S, 2*S);
paint.addColorTextureEffect(texture, tm);
- ctx->drawRect(paint, GrRect::MakeWH(2*S, 2*S));
+ ctx->drawRect(paint, SkRect::MakeWH(2*S, 2*S));
// now update the lower right of the texture in first pass
// or upper right in second pass
@@ -129,7 +129,7 @@
texture->writePixels(S, (i ? 0 : S), S, S,
texture->config(), gTextureData,
4 * stride);
- ctx->drawRect(paint, GrRect::MakeWH(2*S, 2*S));
+ ctx->drawRect(paint, SkRect::MakeWH(2*S, 2*S));
}
}
}
diff --git a/include/gpu/GrAARectRenderer.h b/include/gpu/GrAARectRenderer.h
index a19b07a..607329a 100644
--- a/include/gpu/GrAARectRenderer.h
+++ b/include/gpu/GrAARectRenderer.h
@@ -9,9 +9,9 @@
#ifndef GrAARectRenderer_DEFINED
#define GrAARectRenderer_DEFINED
-#include "GrRect.h"
#include "GrRefCnt.h"
#include "SkMatrix.h"
+#include "SkRect.h"
class GrGpu;
class GrDrawTarget;
@@ -40,9 +40,9 @@
void fillAARect(GrGpu* gpu,
GrDrawTarget* target,
- const GrRect& rect,
+ const SkRect& rect,
const SkMatrix& combinedMatrix,
- const GrRect& devRect,
+ const SkRect& devRect,
bool useVertexCoverage) {
#ifdef SHADER_AA_FILL_RECT
if (combinedMatrix.rectStaysRect()) {
@@ -61,9 +61,9 @@
void strokeAARect(GrGpu* gpu,
GrDrawTarget* target,
- const GrRect& rect,
+ const SkRect& rect,
const SkMatrix& combinedMatrix,
- const GrRect& devRect,
+ const SkRect& devRect,
SkScalar width,
bool useVertexCoverage);
@@ -87,19 +87,19 @@
// since we now have a coverage vertex attribute
void geometryFillAARect(GrGpu* gpu,
GrDrawTarget* target,
- const GrRect& rect,
+ const SkRect& rect,
const SkMatrix& combinedMatrix,
- const GrRect& devRect,
+ const SkRect& devRect,
bool useVertexCoverage);
void shaderFillAARect(GrGpu* gpu,
GrDrawTarget* target,
- const GrRect& rect,
+ const SkRect& rect,
const SkMatrix& combinedMatrix);
void shaderFillAlignedAARect(GrGpu* gpu,
GrDrawTarget* target,
- const GrRect& rect,
+ const SkRect& rect,
const SkMatrix& combinedMatrix);
void geometryStrokeAARect(GrGpu* gpu,
diff --git a/include/gpu/GrClipData.h b/include/gpu/GrClipData.h
index 078b61e..bced741 100644
--- a/include/gpu/GrClipData.h
+++ b/include/gpu/GrClipData.h
@@ -1,4 +1,3 @@
-
/*
* Copyright 2010 Google Inc.
*
@@ -6,15 +5,13 @@
* found in the LICENSE file.
*/
-
-
#ifndef GrClip_DEFINED
#define GrClip_DEFINED
-#include "GrRect.h"
#include "SkClipStack.h"
class GrSurface;
+struct SkIRect;
/**
* GrClipData encapsulates the information required to construct the clip
@@ -50,7 +47,7 @@
}
void getConservativeBounds(const GrSurface* surface,
- GrIRect* devResult,
+ SkIRect* devResult,
bool* isIntersectionOfRects = NULL) const;
};
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index c0f5bb8..53d479c 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -1,4 +1,3 @@
-
/*
* Copyright 2010 Google Inc.
*
@@ -6,7 +5,6 @@
* found in the LICENSE file.
*/
-
#ifndef GrContext_DEFINED
#define GrContext_DEFINED
@@ -16,6 +14,7 @@
#include "SkMatrix.h"
#include "GrPaint.h"
#include "GrPathRendererChain.h"
+#include "GrPoint.h"
#include "GrRenderTarget.h"
#include "GrRefCnt.h"
#include "GrTexture.h"
@@ -370,7 +369,7 @@
* @param target if non-NULL, the render target to clear otherwise clear
* the current render target
*/
- void clear(const GrIRect* rect, GrColor color,
+ void clear(const SkIRect* rect, GrColor color,
GrRenderTarget* target = NULL);
/**
@@ -390,7 +389,7 @@
* The rects coords are used to access the paint (through texture matrix)
*/
void drawRect(const GrPaint& paint,
- const GrRect&,
+ const SkRect&,
SkScalar strokeWidth = -1,
const SkMatrix* matrix = NULL);
@@ -408,8 +407,8 @@
* @param localMatrix Optional matrix to transform localRect.
*/
void drawRectToRect(const GrPaint& paint,
- const GrRect& dstRect,
- const GrRect& localRect,
+ const SkRect& dstRect,
+ const SkRect& localRect,
const SkMatrix* dstMatrix = NULL,
const SkMatrix* localMatrix = NULL);
@@ -466,7 +465,7 @@
* @param stroke the stroke information (width, style)
*/
void drawOval(const GrPaint& paint,
- const GrRect& oval,
+ const SkRect& oval,
const SkStrokeRec& stroke);
///////////////////////////////////////////////////////////////////////////
@@ -771,7 +770,7 @@
context->setClip(&fNewClipData);
}
- AutoClip(GrContext* context, const GrRect& newClipRect)
+ AutoClip(GrContext* context, const SkRect& newClipRect)
: fContext(context)
, fNewClipStack(newClipRect) {
fNewClipData.fClipStack = &fNewClipStack;
diff --git a/include/gpu/GrFontScaler.h b/include/gpu/GrFontScaler.h
index e3a7a2a..f5dcf53 100644
--- a/include/gpu/GrFontScaler.h
+++ b/include/gpu/GrFontScaler.h
@@ -1,4 +1,3 @@
-
/*
* Copyright 2010 Google Inc.
*
@@ -6,8 +5,6 @@
* found in the LICENSE file.
*/
-
-
#ifndef GrFontScaler_DEFINED
#define GrFontScaler_DEFINED
@@ -29,7 +26,7 @@
virtual const GrKey* getKey() = 0;
virtual GrMaskFormat getMaskFormat() = 0;
- virtual bool getPackedGlyphBounds(GrGlyph::PackedID, GrIRect* bounds) = 0;
+ virtual bool getPackedGlyphBounds(GrGlyph::PackedID, SkIRect* bounds) = 0;
virtual bool getPackedGlyphImage(GrGlyph::PackedID, int width, int height,
int rowBytes, void* image) = 0;
virtual bool getGlyphPath(uint16_t glyphID, SkPath*) = 0;
diff --git a/include/gpu/GrGlyph.h b/include/gpu/GrGlyph.h
index 4945f2a..c730f24 100644
--- a/include/gpu/GrGlyph.h
+++ b/include/gpu/GrGlyph.h
@@ -1,4 +1,3 @@
-
/*
* Copyright 2010 Google Inc.
*
@@ -6,8 +5,6 @@
* found in the LICENSE file.
*/
-
-
#ifndef GrGlyph_DEFINED
#define GrGlyph_DEFINED
@@ -31,7 +28,7 @@
GrIRect16 fBounds;
GrIPoint16 fAtlasLocation;
- void init(GrGlyph::PackedID packed, const GrIRect& bounds) {
+ void init(GrGlyph::PackedID packed, const SkIRect& bounds) {
fAtlas = NULL;
fPath = NULL;
fPackedID = packed;
diff --git a/include/gpu/GrOvalRenderer.h b/include/gpu/GrOvalRenderer.h
index a9d41b4..08d3d3d 100644
--- a/include/gpu/GrOvalRenderer.h
+++ b/include/gpu/GrOvalRenderer.h
@@ -5,18 +5,17 @@
* found in the LICENSE file.
*/
-
#ifndef GrOvalRenderer_DEFINED
#define GrOvalRenderer_DEFINED
#include "GrContext.h"
#include "GrPaint.h"
#include "GrRefCnt.h"
-#include "GrRect.h"
class GrContext;
class GrDrawTarget;
class GrPaint;
+struct SkRect;
class SkStrokeRec;
/*
@@ -34,16 +33,16 @@
void reset();
bool drawOval(GrDrawTarget* target, const GrContext* context, bool useAA,
- const GrRect& oval, const SkStrokeRec& stroke);
+ const SkRect& oval, const SkStrokeRec& stroke);
bool drawSimpleRRect(GrDrawTarget* target, GrContext* context, bool useAA,
const SkRRect& rrect, const SkStrokeRec& stroke);
private:
bool drawEllipse(GrDrawTarget* target, bool useAA,
- const GrRect& ellipse,
+ const SkRect& ellipse,
const SkStrokeRec& stroke);
void drawCircle(GrDrawTarget* target, bool useAA,
- const GrRect& circle,
+ const SkRect& circle,
const SkStrokeRec& stroke);
GrIndexBuffer* rRectIndexBuffer(GrGpu* gpu);
diff --git a/include/gpu/GrRect.h b/include/gpu/GrRect.h
index 821e137..cacc511 100644
--- a/include/gpu/GrRect.h
+++ b/include/gpu/GrRect.h
@@ -1,4 +1,3 @@
-
/*
* Copyright 2010 Google Inc.
*
@@ -6,17 +5,12 @@
* found in the LICENSE file.
*/
-
-
#ifndef GrRect_DEFINED
#define GrRect_DEFINED
-#include "GrPoint.h"
+#include "SkTypes.h"
#include "SkRect.h"
-typedef SkIRect GrIRect;
-typedef SkRect GrRect;
-
struct GrIRect16 {
int16_t fLeft, fTop, fRight, fBottom;
@@ -25,7 +19,7 @@
int area() const { return this->width() * this->height(); }
bool isEmpty() const { return fLeft >= fRight || fTop >= fBottom; }
- void set(const GrIRect& r) {
+ void set(const SkIRect& r) {
fLeft = SkToS16(r.fLeft);
fTop = SkToS16(r.fTop);
fRight = SkToS16(r.fRight);
diff --git a/include/gpu/GrRenderTarget.h b/include/gpu/GrRenderTarget.h
index 2755bec..eab65b5 100644
--- a/include/gpu/GrRenderTarget.h
+++ b/include/gpu/GrRenderTarget.h
@@ -8,8 +8,8 @@
#ifndef GrRenderTarget_DEFINED
#define GrRenderTarget_DEFINED
-#include "GrRect.h"
#include "GrSurface.h"
+#include "SkRect.h"
class GrStencilBuffer;
class GrTexture;
@@ -90,12 +90,12 @@
* @param rect a rect bounding the area needing resolve. NULL indicates
* the whole RT needs resolving.
*/
- void flagAsNeedingResolve(const GrIRect* rect = NULL);
+ void flagAsNeedingResolve(const SkIRect* rect = NULL);
/**
* Call to override the region that needs to be resolved.
*/
- void overrideResolveRect(const GrIRect rect);
+ void overrideResolveRect(const SkIRect rect);
/**
* Call to indicate that GrRenderTarget was externally resolved. This may
@@ -111,7 +111,7 @@
/**
* Returns a rect bounding the region needing resolving.
*/
- const GrIRect& getResolveRect() const { return fResolveRect; }
+ const SkIRect& getResolveRect() const { return fResolveRect; }
/**
* If the render target is multisampled this will perform a multisample
@@ -163,7 +163,7 @@
GrStencilBuffer* fStencilBuffer;
GrTexture* fTexture; // not ref'ed
- GrIRect fResolveRect;
+ SkIRect fResolveRect;
typedef GrSurface INHERITED;
};
diff --git a/include/gpu/GrTextContext.h b/include/gpu/GrTextContext.h
index 348f3ab..5204da4 100644
--- a/include/gpu/GrTextContext.h
+++ b/include/gpu/GrTextContext.h
@@ -1,4 +1,3 @@
-
/*
* Copyright 2010 Google Inc.
*
@@ -6,8 +5,6 @@
* found in the LICENSE file.
*/
-
-
#ifndef GrTextContext_DEFINED
#define GrTextContext_DEFINED
@@ -53,7 +50,7 @@
GrTexture* fCurrTexture;
int fCurrVertex;
- GrIRect fClipRect;
+ SkIRect fClipRect;
GrContext::AutoMatrix fAutoMatrix;
};
diff --git a/include/gpu/SkGr.h b/include/gpu/SkGr.h
index 69d811f..1f72fbc 100644
--- a/include/gpu/SkGr.h
+++ b/include/gpu/SkGr.h
@@ -85,7 +85,7 @@
// overrides
virtual const GrKey* getKey();
virtual GrMaskFormat getMaskFormat();
- virtual bool getPackedGlyphBounds(GrGlyph::PackedID, GrIRect* bounds);
+ virtual bool getPackedGlyphBounds(GrGlyph::PackedID, SkIRect* bounds);
virtual bool getPackedGlyphImage(GrGlyph::PackedID, int width, int height,
int rowBytes, void* image);
virtual bool getGlyphPath(uint16_t glyphID, SkPath*);
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 4783abd..ab3458c 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -469,7 +469,7 @@
GrContext::AutoMatrix am;
am.setIdentity(context);
- GrContext::AutoClip acs(context, GrRect::MakeWH(SkIntToScalar(srcTexture->width()),
+ GrContext::AutoClip acs(context, SkRect::MakeWH(SkIntToScalar(srcTexture->width()),
SkIntToScalar(srcTexture->height())));
GrTextureDesc desc;
diff --git a/src/gpu/GrAAHairLinePathRenderer.cpp b/src/gpu/GrAAHairLinePathRenderer.cpp
index 1895da9..67c2a32 100644
--- a/src/gpu/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/GrAAHairLinePathRenderer.cpp
@@ -251,7 +251,7 @@
*/
int generate_lines_and_quads(const SkPath& path,
const SkMatrix& m,
- const GrIRect& devClipBounds,
+ const SkIRect& devClipBounds,
PtArray* lines,
PtArray* quads,
PtArray* conics,
@@ -260,8 +260,8 @@
SkPath::Iter iter(path, false);
int totalQuadCount = 0;
- GrRect bounds;
- GrIRect ibounds;
+ SkRect bounds;
+ SkIRect ibounds;
bool persp = m.hasPerspective();
@@ -986,7 +986,7 @@
GrDrawState* drawState = target->drawState();
int rtHeight = drawState->getRenderTarget()->height();
- GrIRect devClipBounds;
+ SkIRect devClipBounds;
target->getClip()->getConservativeBounds(drawState->getRenderTarget(), &devClipBounds);
SkMatrix viewM = drawState->getViewMatrix();
diff --git a/src/gpu/GrAARectRenderer.cpp b/src/gpu/GrAARectRenderer.cpp
index 5b10e95..3a6ff30 100644
--- a/src/gpu/GrAARectRenderer.cpp
+++ b/src/gpu/GrAARectRenderer.cpp
@@ -277,7 +277,7 @@
}
static void set_inset_fan(GrPoint* pts, size_t stride,
- const GrRect& r, SkScalar dx, SkScalar dy) {
+ const SkRect& r, SkScalar dx, SkScalar dy) {
pts->setRectFan(r.fLeft + dx, r.fTop + dy,
r.fRight - dx, r.fBottom - dy, stride);
}
@@ -376,9 +376,9 @@
void GrAARectRenderer::geometryFillAARect(GrGpu* gpu,
GrDrawTarget* target,
- const GrRect& rect,
+ const SkRect& rect,
const SkMatrix& combinedMatrix,
- const GrRect& devRect,
+ const SkRect& devRect,
bool useVertexCoverage) {
GrDrawState* drawState = target->drawState();
@@ -525,7 +525,7 @@
void GrAARectRenderer::shaderFillAARect(GrGpu* gpu,
GrDrawTarget* target,
- const GrRect& rect,
+ const SkRect& rect,
const SkMatrix& combinedMatrix) {
GrDrawState* drawState = target->drawState();
@@ -589,7 +589,7 @@
void GrAARectRenderer::shaderFillAlignedAARect(GrGpu* gpu,
GrDrawTarget* target,
- const GrRect& rect,
+ const SkRect& rect,
const SkMatrix& combinedMatrix) {
GrDrawState* drawState = target->drawState();
SkASSERT(combinedMatrix.rectStaysRect());
@@ -647,9 +647,9 @@
void GrAARectRenderer::strokeAARect(GrGpu* gpu,
GrDrawTarget* target,
- const GrRect& rect,
+ const SkRect& rect,
const SkMatrix& combinedMatrix,
- const GrRect& devRect,
+ const SkRect& devRect,
SkScalar width,
bool useVertexCoverage) {
GrVec devStrokeSize;
@@ -681,7 +681,7 @@
spare = GrMin(w, h);
}
- GrRect devOutside(devRect);
+ SkRect devOutside(devRect);
devOutside.outset(rx, ry);
if (spare <= 0) {
diff --git a/src/gpu/GrClipData.cpp b/src/gpu/GrClipData.cpp
index ce9dcdf..22b4371 100644
--- a/src/gpu/GrClipData.cpp
+++ b/src/gpu/GrClipData.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2010 Google Inc.
*
@@ -7,8 +6,9 @@
*/
#include "GrClipData.h"
+
#include "GrSurface.h"
-#include "GrRect.h"
+#include "SkRect.h"
///////////////////////////////////////////////////////////////////////////////
@@ -19,9 +19,9 @@
* isIntersectionOfRects will be set to true.
*/
void GrClipData::getConservativeBounds(const GrSurface* surface,
- GrIRect* devResult,
+ SkIRect* devResult,
bool* isIntersectionOfRects) const {
- GrRect devBounds;
+ SkRect devBounds;
fClipStack->getConservativeBounds(-fOrigin.fX,
-fOrigin.fY,
diff --git a/src/gpu/GrClipMaskCache.h b/src/gpu/GrClipMaskCache.h
index 9a091c4..330a1f2 100644
--- a/src/gpu/GrClipMaskCache.h
+++ b/src/gpu/GrClipMaskCache.h
@@ -118,7 +118,7 @@
void acquireMask(int32_t clipGenID,
const GrTextureDesc& desc,
- const GrIRect& bound) {
+ const SkIRect& bound) {
if (fStack.empty()) {
GrAssert(false);
@@ -162,7 +162,7 @@
return back->fLastMask.texture()->height();
}
- void getLastBound(GrIRect* bound) const {
+ void getLastBound(SkIRect* bound) const {
if (fStack.empty()) {
GrAssert(false);
@@ -203,7 +203,7 @@
void acquireMask(GrContext* context,
int32_t clipGenID,
const GrTextureDesc& desc,
- const GrIRect& bound) {
+ const SkIRect& bound) {
fLastClipGenID = clipGenID;
@@ -227,7 +227,7 @@
GrAutoScratchTexture fLastMask;
// fLastBound stores the bounding box of the clip mask in clip-stack space. This rect is
// used by GrClipMaskManager to position a rect and compute texture coords for the mask.
- GrIRect fLastBound;
+ SkIRect fLastBound;
};
GrContext* fContext;
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index bc20c25..faeac27 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -33,7 +33,7 @@
// stage matrix this also alters the vertex layout
void setup_drawstate_aaclip(GrGpu* gpu,
GrTexture* result,
- const GrIRect &devBound) {
+ const SkIRect &devBound) {
GrDrawState* drawState = gpu->drawState();
GrAssert(drawState);
@@ -345,8 +345,8 @@
void GrClipMaskManager::mergeMask(GrTexture* dstMask,
GrTexture* srcMask,
SkRegion::Op op,
- const GrIRect& dstBound,
- const GrIRect& srcBound) {
+ const SkIRect& dstBound,
+ const SkIRect& srcBound) {
GrDrawState::AutoViewMatrixRestore avmr;
GrDrawState* drawState = fGpu->drawState();
SkAssertResult(avmr.setIdentity(drawState));
@@ -482,13 +482,13 @@
// mask buffer can be substantially larger than the actually clip stack element. We
// touch the minimum number of pixels necessary and use decal mode to combine it with
// the accumulator.
- GrIRect maskSpaceElementIBounds;
+ SkIRect maskSpaceElementIBounds;
if (useTemp) {
if (invert) {
maskSpaceElementIBounds = maskSpaceIBounds;
} else {
- GrRect elementBounds = element->getBounds();
+ SkRect elementBounds = element->getBounds();
elementBounds.offset(clipToMaskOffset);
elementBounds.roundOut(&maskSpaceElementIBounds);
}
diff --git a/src/gpu/GrClipMaskManager.h b/src/gpu/GrClipMaskManager.h
index 121737b..2cba477 100644
--- a/src/gpu/GrClipMaskManager.h
+++ b/src/gpu/GrClipMaskManager.h
@@ -12,7 +12,6 @@
#include "GrContext.h"
#include "GrDrawState.h"
#include "GrNoncopyable.h"
-#include "GrRect.h"
#include "GrReducedClip.h"
#include "GrStencil.h"
#include "GrTexture.h"
@@ -142,13 +141,13 @@
void mergeMask(GrTexture* dstMask,
GrTexture* srcMask,
SkRegion::Op op,
- const GrIRect& dstBound,
- const GrIRect& srcBound);
+ const SkIRect& dstBound,
+ const SkIRect& srcBound);
void getTemp(int width, int height, GrAutoScratchTexture* temp);
void setupCache(const SkClipStack& clip,
- const GrIRect& bounds);
+ const SkIRect& bounds);
/**
* Called prior to return control back the GrGpu in setupClipping. It
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index f4b71ae..ee8d9f7 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -575,7 +575,7 @@
////////////////////////////////////////////////////////////////////////////////
-void GrContext::clear(const GrIRect* rect,
+void GrContext::clear(const SkIRect* rect,
const GrColor color,
GrRenderTarget* target) {
AutoRestoreEffects are;
@@ -585,7 +585,7 @@
void GrContext::drawPaint(const GrPaint& origPaint) {
// set rect to be big enough to fill the space, but not super-huge, so we
// don't overflow fixed-point implementations
- GrRect r;
+ SkRect r;
r.setLTRB(0, 0,
SkIntToScalar(getRenderTarget()->width()),
SkIntToScalar(getRenderTarget()->height()));
@@ -630,7 +630,7 @@
could use an indices array, and then only send 8 verts, but not sure that
would be faster.
*/
-static void setStrokeRectStrip(GrPoint verts[10], GrRect rect,
+static void setStrokeRectStrip(GrPoint verts[10], SkRect rect,
SkScalar width) {
const SkScalar rad = SkScalarHalf(width);
rect.sort();
@@ -647,17 +647,17 @@
verts[9] = verts[1];
}
-static bool isIRect(const GrRect& r) {
+static bool isIRect(const SkRect& r) {
return SkScalarIsInt(r.fLeft) && SkScalarIsInt(r.fTop) &&
SkScalarIsInt(r.fRight) && SkScalarIsInt(r.fBottom);
}
static bool apply_aa_to_rect(GrDrawTarget* target,
- const GrRect& rect,
+ const SkRect& rect,
SkScalar strokeWidth,
const SkMatrix* matrix,
SkMatrix* combinedMatrix,
- GrRect* devRect,
+ SkRect* devRect,
bool* useVertexCoverage) {
// we use a simple coverage ramp to do aa on axis-aligned rects
// we check if the rect will be axis-aligned, and the rect won't land on
@@ -737,7 +737,7 @@
}
void GrContext::drawRect(const GrPaint& paint,
- const GrRect& rect,
+ const SkRect& rect,
SkScalar width,
const SkMatrix* matrix) {
SK_TRACE_EVENT0("GrContext::drawRect");
@@ -745,7 +745,7 @@
AutoRestoreEffects are;
GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are);
- GrRect devRect;
+ SkRect devRect;
SkMatrix combinedMatrix;
bool useVertexCoverage;
bool needAA = paint.isAntiAlias() &&
@@ -818,8 +818,8 @@
}
void GrContext::drawRectToRect(const GrPaint& paint,
- const GrRect& dstRect,
- const GrRect& localRect,
+ const SkRect& dstRect,
+ const SkRect& localRect,
const SkMatrix* dstMatrix,
const SkMatrix* localMatrix) {
SK_TRACE_EVENT0("GrContext::drawRectToRect");
@@ -945,7 +945,7 @@
///////////////////////////////////////////////////////////////////////////////
void GrContext::drawOval(const GrPaint& paint,
- const GrRect& oval,
+ const SkRect& oval,
const SkStrokeRec& stroke) {
AutoRestoreEffects are;
@@ -1319,7 +1319,7 @@
drawState->addColorEffect(effect);
drawState->setRenderTarget(texture->asRenderTarget());
- GrRect rect = GrRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height));
+ SkRect rect = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height));
fGpu->drawSimpleRect(rect, NULL);
// we want to read back from the scratch's origin
left = 0;
@@ -1513,7 +1513,7 @@
drawState->setRenderTarget(target);
- fGpu->drawSimpleRect(GrRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height)), NULL);
+ fGpu->drawSimpleRect(SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height)), NULL);
return true;
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/GrDefaultPathRenderer.cpp b/src/gpu/GrDefaultPathRenderer.cpp
index 19fd2be..6d16fb6 100644
--- a/src/gpu/GrDefaultPathRenderer.cpp
+++ b/src/gpu/GrDefaultPathRenderer.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2011 Google Inc.
*
@@ -461,7 +460,7 @@
if (!colorWritesWereDisabled) {
drawState->disableState(GrDrawState::kNoColorWrites_StateBit);
}
- GrRect bounds;
+ SkRect bounds;
GrDrawState::AutoViewMatrixRestore avmr;
if (reverse) {
GrAssert(NULL != drawState->getRenderTarget());
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h
index c4f8726..1a67bb1 100644
--- a/src/gpu/GrDrawState.h
+++ b/src/gpu/GrDrawState.h
@@ -12,6 +12,7 @@
#include "GrColor.h"
#include "GrEffectStage.h"
#include "GrPaint.h"
+#include "GrPoint.h"
#include "GrRefCnt.h"
#include "GrRenderTarget.h"
#include "GrStencil.h"
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 1f3b630..9fdb0f4 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -420,7 +420,7 @@
GrRenderTarget* rt = this->drawState()->getRenderTarget();
const GrClipData* clip = this->getClip();
- GrIRect copyRect;
+ SkIRect copyRect;
clip->getConservativeBounds(this->getDrawState().getRenderTarget(), ©Rect);
SkIRect drawIBounds;
if (info->getDevIBounds(&drawIBounds)) {
@@ -615,9 +615,9 @@
};
-void GrDrawTarget::onDrawRect(const GrRect& rect,
+void GrDrawTarget::onDrawRect(const SkRect& rect,
const SkMatrix* matrix,
- const GrRect* localRect,
+ const SkRect* localRect,
const SkMatrix* localMatrix) {
GrDrawState::AutoViewMatrixRestore avmr;
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index f31dd6c..0c2b568 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -343,9 +343,9 @@
* then srcRect will be transformed by srcMatrix.
* srcMatrix can be NULL when no srcMatrix is desired.
*/
- void drawRect(const GrRect& rect,
+ void drawRect(const SkRect& rect,
const SkMatrix* matrix,
- const GrRect* localRect,
+ const SkRect* localRect,
const SkMatrix* localMatrix) {
AutoGeometryPush agp(this);
this->onDrawRect(rect, matrix, localRect, localMatrix);
@@ -354,10 +354,10 @@
/**
* Helper for drawRect when the caller doesn't need separate local rects or matrices.
*/
- void drawSimpleRect(const GrRect& rect, const SkMatrix* matrix = NULL) {
+ void drawSimpleRect(const SkRect& rect, const SkMatrix* matrix = NULL) {
this->drawRect(rect, matrix, NULL, NULL);
}
- void drawSimpleRect(const GrIRect& irect, const SkMatrix* matrix = NULL) {
+ void drawSimpleRect(const SkIRect& irect, const SkMatrix* matrix = NULL) {
SkRect rect = SkRect::MakeFromIRect(irect);
this->drawRect(rect, matrix, NULL, NULL);
}
@@ -403,7 +403,7 @@
* clip and all other draw state (blend mode, stages, etc). Clears the
* whole thing if rect is NULL, otherwise just the rect.
*/
- virtual void clear(const GrIRect* rect,
+ virtual void clear(const SkIRect* rect,
GrColor color,
GrRenderTarget* renderTarget = NULL) = 0;
@@ -814,9 +814,9 @@
// one of the public GrDrawTarget draw methods (e.g. drawNonIndexed,
// drawIndexedInstances, ...). The base class draws a two triangle fan using
// drawNonIndexed from reserved vertex space.
- virtual void onDrawRect(const GrRect& rect,
+ virtual void onDrawRect(const SkRect& rect,
const SkMatrix* matrix,
- const GrRect* localRect,
+ const SkRect* localRect,
const SkMatrix* localMatrix);
virtual void onStencilPath(const GrPath*, const SkStrokeRec& stroke, SkPath::FillType fill) = 0;
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 5d6c62f..c4d8318 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -203,7 +203,7 @@
return this->onCreatePath(path);
}
-void GrGpu::clear(const GrIRect* rect,
+void GrGpu::clear(const SkIRect* rect,
GrColor color,
GrRenderTarget* renderTarget) {
GrDrawState::AutoRenderTargetRestore art;
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index 85e3988..86c25ee 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -1,4 +1,3 @@
-
/*
* Copyright 2011 Google Inc.
*
@@ -6,15 +5,12 @@
* found in the LICENSE file.
*/
-
#ifndef GrGpu_DEFINED
#define GrGpu_DEFINED
#include "GrDrawTarget.h"
-#include "GrRect.h"
#include "GrRefCnt.h"
#include "GrClipMaskManager.h"
-
#include "SkPath.h"
class GrContext;
@@ -27,7 +23,6 @@
class GrVertexBufferAllocPool;
class GrGpu : public GrDrawTarget {
-
public:
/**
@@ -269,7 +264,7 @@
void removeResource(GrResource* resource);
// GrDrawTarget overrides
- virtual void clear(const GrIRect* rect,
+ virtual void clear(const SkIRect* rect,
GrColor color,
GrRenderTarget* renderTarget = NULL) SK_OVERRIDE;
@@ -310,7 +305,7 @@
* onStencilPath member functions.) The GrGpu subclass should flush the
* stencil state to the 3D API in its implementation of flushGraphicsState.
*/
- void enableScissor(const GrIRect& rect) {
+ void enableScissor(const SkIRect& rect) {
fScissorState.fEnabled = true;
fScissorState.fRect = rect;
}
@@ -331,7 +326,7 @@
// GrGpu subclass sets clip bit in the stencil buffer. The subclass is
// free to clear the remaining bits to zero if masked clears are more
// expensive than clearing all bits.
- virtual void clearStencilClip(const GrIRect& rect, bool insideClip) = 0;
+ virtual void clearStencilClip(const SkIRect& rect, bool insideClip) = 0;
enum PrivateDrawStateStateBits {
kFirstBit = (GrDrawState::kLastPublicStateBit << 1),
@@ -398,7 +393,7 @@
// The state of the scissor is controlled by the clip manager
struct ScissorState {
bool fEnabled;
- GrIRect fRect;
+ SkIRect fRect;
} fScissorState;
// The final stencil settings to use as determined by the clip manager.
@@ -442,7 +437,7 @@
// overridden by backend-specific derived class to perform the clear and
// clearRect. NULL rect means clear whole target.
- virtual void onClear(const GrIRect* rect, GrColor color) = 0;
+ virtual void onClear(const SkIRect* rect, GrColor color) = 0;
// overridden by backend-specific derived class to perform the draw call.
virtual void onGpuDraw(const DrawInfo&) = 0;
diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp
index dde66c5..3ec9596 100644
--- a/src/gpu/GrInOrderDrawBuffer.cpp
+++ b/src/gpu/GrInOrderDrawBuffer.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2011 Google Inc.
*
@@ -6,13 +5,14 @@
* found in the LICENSE file.
*/
-
#include "GrInOrderDrawBuffer.h"
+
#include "GrBufferAllocPool.h"
#include "GrDrawTargetCaps.h"
#include "GrGpu.h"
#include "GrIndexBuffer.h"
#include "GrPath.h"
+#include "GrPoint.h"
#include "GrRenderTarget.h"
#include "GrTemplates.h"
#include "GrTexture.h"
@@ -117,9 +117,9 @@
};
-void GrInOrderDrawBuffer::onDrawRect(const GrRect& rect,
+void GrInOrderDrawBuffer::onDrawRect(const SkRect& rect,
const SkMatrix* matrix,
- const GrRect* localRect,
+ const SkRect* localRect,
const SkMatrix* localMatrix) {
GrDrawState::AutoColorRestore acr;
@@ -401,8 +401,8 @@
sp->fStroke = stroke;
}
-void GrInOrderDrawBuffer::clear(const GrIRect* rect, GrColor color, GrRenderTarget* renderTarget) {
- GrIRect r;
+void GrInOrderDrawBuffer::clear(const SkIRect* rect, GrColor color, GrRenderTarget* renderTarget) {
+ SkIRect r;
if (NULL == renderTarget) {
renderTarget = this->drawState()->getRenderTarget();
GrAssert(NULL != renderTarget);
diff --git a/src/gpu/GrInOrderDrawBuffer.h b/src/gpu/GrInOrderDrawBuffer.h
index 0871cc5..6512dcc 100644
--- a/src/gpu/GrInOrderDrawBuffer.h
+++ b/src/gpu/GrInOrderDrawBuffer.h
@@ -69,7 +69,7 @@
// overrides from GrDrawTarget
virtual bool geometryHints(int* vertexCount,
int* indexCount) const SK_OVERRIDE;
- virtual void clear(const GrIRect* rect,
+ virtual void clear(const SkIRect* rect,
GrColor color,
GrRenderTarget* renderTarget = NULL) SK_OVERRIDE;
@@ -108,7 +108,7 @@
Clear() : fRenderTarget(NULL) {}
~Clear() { GrSafeUnref(fRenderTarget); }
- GrIRect fRect;
+ SkIRect fRect;
GrColor fColor;
GrRenderTarget* fRenderTarget;
};
@@ -122,9 +122,9 @@
// overrides from GrDrawTarget
virtual void onDraw(const DrawInfo&) SK_OVERRIDE;
- virtual void onDrawRect(const GrRect& rect,
+ virtual void onDrawRect(const SkRect& rect,
const SkMatrix* matrix,
- const GrRect* localRect,
+ const SkRect* localRect,
const SkMatrix* localMatrix) SK_OVERRIDE;
virtual void onStencilPath(const GrPath*, const SkStrokeRec& stroke, SkPath::FillType) SK_OVERRIDE;
virtual bool onReserveVertexSpace(size_t vertexSize,
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp
index 85526dc..6ea922c 100644
--- a/src/gpu/GrOvalRenderer.cpp
+++ b/src/gpu/GrOvalRenderer.cpp
@@ -291,7 +291,7 @@
}
bool GrOvalRenderer::drawOval(GrDrawTarget* target, const GrContext* context, bool useAA,
- const GrRect& oval, const SkStrokeRec& stroke)
+ const SkRect& oval, const SkStrokeRec& stroke)
{
if (!useAA) {
return false;
@@ -329,7 +329,7 @@
void GrOvalRenderer::drawCircle(GrDrawTarget* target,
bool useAA,
- const GrRect& circle,
+ const SkRect& circle,
const SkStrokeRec& stroke)
{
GrDrawState* drawState = target->drawState();
@@ -432,7 +432,7 @@
bool GrOvalRenderer::drawEllipse(GrDrawTarget* target,
bool useAA,
- const GrRect& ellipse,
+ const SkRect& ellipse,
const SkStrokeRec& stroke)
{
GrDrawState* drawState = target->drawState();
diff --git a/src/gpu/GrPath.h b/src/gpu/GrPath.h
index ad3a5c3..c7e7f92 100644
--- a/src/gpu/GrPath.h
+++ b/src/gpu/GrPath.h
@@ -1,4 +1,3 @@
-
/*
* Copyright 2012 Google Inc.
*
@@ -10,7 +9,7 @@
#define GrPath_DEFINED
#include "GrResource.h"
-#include "GrRect.h"
+#include "SkRect.h"
class GrPath : public GrResource {
public:
@@ -18,10 +17,10 @@
GrPath(GrGpu* gpu, bool isWrapped) : INHERITED(gpu, isWrapped) {}
- const GrRect& getBounds() const { return fBounds; }
+ const SkRect& getBounds() const { return fBounds; }
protected:
- GrRect fBounds;
+ SkRect fBounds;
private:
typedef GrResource INHERITED;
diff --git a/src/gpu/GrPathUtils.cpp b/src/gpu/GrPathUtils.cpp
index f6cd26b..f169455 100644
--- a/src/gpu/GrPathUtils.cpp
+++ b/src/gpu/GrPathUtils.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2011 Google Inc.
*
@@ -6,14 +5,14 @@
* found in the LICENSE file.
*/
-
#include "GrPathUtils.h"
+
#include "GrPoint.h"
#include "SkGeometry.h"
SkScalar GrPathUtils::scaleToleranceToSrc(SkScalar devTol,
const SkMatrix& viewM,
- const GrRect& pathBounds) {
+ const SkRect& pathBounds) {
// In order to tesselate the path we get a bound on how much the matrix can
// stretch when mapping to screen coordinates.
SkScalar stretch = viewM.getMaxStretch();
diff --git a/src/gpu/GrPathUtils.h b/src/gpu/GrPathUtils.h
index 2d6045e..fc319ec 100644
--- a/src/gpu/GrPathUtils.h
+++ b/src/gpu/GrPathUtils.h
@@ -1,4 +1,3 @@
-
/*
* Copyright 2011 Google Inc.
*
@@ -6,11 +5,11 @@
* found in the LICENSE file.
*/
-
#ifndef GrPathUtils_DEFINED
#define GrPathUtils_DEFINED
-#include "GrRect.h"
+#include "GrPoint.h"
+#include "SkRect.h"
#include "SkPath.h"
#include "SkTArray.h"
@@ -22,7 +21,7 @@
namespace GrPathUtils {
SkScalar scaleToleranceToSrc(SkScalar devTol,
const SkMatrix& viewM,
- const GrRect& pathBounds);
+ const SkRect& pathBounds);
/// Since we divide by tol if we're computing exact worst-case bounds,
/// very small tolerances will be increased to gMinCurveTol.
diff --git a/src/gpu/GrRectanizer.h b/src/gpu/GrRectanizer.h
index 44d14a1..bacf4fd 100644
--- a/src/gpu/GrRectanizer.h
+++ b/src/gpu/GrRectanizer.h
@@ -1,4 +1,3 @@
-
/*
* Copyright 2010 Google Inc.
*
@@ -6,12 +5,10 @@
* found in the LICENSE file.
*/
-
-
#ifndef GrRectanizer_DEFINED
#define GrRectanizer_DEFINED
-#include "GrRect.h"
+#include "GrPoint.h"
class GrRectanizerPurgeListener {
public:
diff --git a/src/gpu/GrRenderTarget.cpp b/src/gpu/GrRenderTarget.cpp
index 1cbd5f5..f558596 100644
--- a/src/gpu/GrRenderTarget.cpp
+++ b/src/gpu/GrRenderTarget.cpp
@@ -70,7 +70,7 @@
return (size_t)(size / 8);
}
-void GrRenderTarget::flagAsNeedingResolve(const GrIRect* rect) {
+void GrRenderTarget::flagAsNeedingResolve(const SkIRect* rect) {
if (kCanResolve_ResolveType == getResolveType()) {
if (NULL != rect) {
fResolveRect.join(*rect);
@@ -83,7 +83,7 @@
}
}
-void GrRenderTarget::overrideResolveRect(const GrIRect rect) {
+void GrRenderTarget::overrideResolveRect(const SkIRect rect) {
fResolveRect = rect;
if (fResolveRect.isEmpty()) {
fResolveRect.setLargestInverted();
diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp
index c9f3989..3f9251c 100644
--- a/src/gpu/GrSWMaskHelper.cpp
+++ b/src/gpu/GrSWMaskHelper.cpp
@@ -37,7 +37,7 @@
/**
* Draw a single rect element of the clip stack into the accumulation bitmap
*/
-void GrSWMaskHelper::draw(const GrRect& rect, SkRegion::Op op,
+void GrSWMaskHelper::draw(const SkRect& rect, SkRegion::Op op,
bool antiAlias, uint8_t alpha) {
SkPaint paint;
@@ -84,7 +84,7 @@
SkSafeUnref(mode);
}
-bool GrSWMaskHelper::init(const GrIRect& resultBounds,
+bool GrSWMaskHelper::init(const SkIRect& resultBounds,
const SkMatrix* matrix) {
if (NULL != matrix) {
fMatrix = *matrix;
@@ -95,7 +95,7 @@
// Now translate so the bound's UL corner is at the origin
fMatrix.postTranslate(-resultBounds.fLeft * SK_Scalar1,
-resultBounds.fTop * SK_Scalar1);
- GrIRect bounds = GrIRect::MakeWH(resultBounds.width(),
+ SkIRect bounds = SkIRect::MakeWH(resultBounds.width(),
resultBounds.height());
fBM.setConfig(SkBitmap::kA8_Config, bounds.fRight, bounds.fBottom);
@@ -160,7 +160,7 @@
GrTexture* GrSWMaskHelper::DrawPathMaskToTexture(GrContext* context,
const SkPath& path,
const SkStrokeRec& stroke,
- const GrIRect& resultBounds,
+ const SkIRect& resultBounds,
bool antiAlias,
SkMatrix* matrix) {
GrAutoScratchTexture ast;
@@ -184,7 +184,7 @@
void GrSWMaskHelper::DrawToTargetWithPathMask(GrTexture* texture,
GrDrawTarget* target,
- const GrIRect& rect) {
+ const SkIRect& rect) {
GrDrawState* drawState = target->drawState();
GrDrawState::AutoViewMatrixRestore avmr;
@@ -193,11 +193,10 @@
}
GrDrawState::AutoRestoreEffects are(drawState);
- GrRect dstRect = GrRect::MakeLTRB(
- SK_Scalar1 * rect.fLeft,
- SK_Scalar1 * rect.fTop,
- SK_Scalar1 * rect.fRight,
- SK_Scalar1 * rect.fBottom);
+ SkRect dstRect = SkRect::MakeLTRB(SK_Scalar1 * rect.fLeft,
+ SK_Scalar1 * rect.fTop,
+ SK_Scalar1 * rect.fRight,
+ SK_Scalar1 * rect.fBottom);
// We want to use device coords to compute the texture coordinates. We set our matrix to be
// equal to the view matrix followed by a translation so that the top-left of the device bounds
diff --git a/src/gpu/GrSWMaskHelper.h b/src/gpu/GrSWMaskHelper.h
index daf3111..ce5ae28 100644
--- a/src/gpu/GrSWMaskHelper.h
+++ b/src/gpu/GrSWMaskHelper.h
@@ -48,10 +48,10 @@
// may be accumulated in the helper during creation, "resultBounds"
// allows the caller to specify the region of interest - to limit the
// amount of work.
- bool init(const GrIRect& resultBounds, const SkMatrix* matrix);
+ bool init(const SkIRect& resultBounds, const SkMatrix* matrix);
// Draw a single rect into the accumulation bitmap using the specified op
- void draw(const GrRect& rect, SkRegion::Op op,
+ void draw(const SkRect& rect, SkRegion::Op op,
bool antiAlias, uint8_t alpha);
// Draw a single path into the accumuation bitmap using the specified op
@@ -76,7 +76,7 @@
static GrTexture* DrawPathMaskToTexture(GrContext* context,
const SkPath& path,
const SkStrokeRec& stroke,
- const GrIRect& resultBounds,
+ const SkIRect& resultBounds,
bool antiAlias,
SkMatrix* matrix);
@@ -92,7 +92,7 @@
// output of DrawPathMaskToTexture.
static void DrawToTargetWithPathMask(GrTexture* texture,
GrDrawTarget* target,
- const GrIRect& rect);
+ const SkIRect& rect);
protected:
private:
diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp
index 21adc62..d0936d6 100644
--- a/src/gpu/GrSoftwarePathRenderer.cpp
+++ b/src/gpu/GrSoftwarePathRenderer.cpp
@@ -29,9 +29,9 @@
}
GrPathRenderer::StencilSupport GrSoftwarePathRenderer::onGetStencilSupport(
- const SkPath&,
- const SkStrokeRec&,
- const GrDrawTarget*) const {
+ const SkPath&,
+ const SkStrokeRec&,
+ const GrDrawTarget*) const {
return GrPathRenderer::kNoSupport_StencilSupport;
}
@@ -44,14 +44,14 @@
bool get_path_and_clip_bounds(const GrDrawTarget* target,
const SkPath& path,
const SkMatrix& matrix,
- GrIRect* devPathBounds,
- GrIRect* devClipBounds) {
+ SkIRect* devPathBounds,
+ SkIRect* devClipBounds) {
// compute bounds as intersection of rt size, clip, and path
const GrRenderTarget* rt = target->getDrawState().getRenderTarget();
if (NULL == rt) {
return false;
}
- *devPathBounds = GrIRect::MakeWH(rt->width(), rt->height());
+ *devPathBounds = SkIRect::MakeWH(rt->width(), rt->height());
target->getClip()->getConservativeBounds(rt, devClipBounds);
@@ -62,9 +62,9 @@
}
if (!path.getBounds().isEmpty()) {
- GrRect pathSBounds;
+ SkRect pathSBounds;
matrix.mapRect(&pathSBounds, path.getBounds());
- GrIRect pathIBounds;
+ SkIRect pathIBounds;
pathSBounds.roundOut(&pathIBounds);
if (!devPathBounds->intersect(pathIBounds)) {
// set the correct path bounds, as this would be used later.
@@ -72,7 +72,7 @@
return false;
}
} else {
- *devPathBounds = GrIRect::EmptyIRect();
+ *devPathBounds = SkIRect::EmptyIRect();
return false;
}
return true;
@@ -80,13 +80,13 @@
////////////////////////////////////////////////////////////////////////////////
void draw_around_inv_path(GrDrawTarget* target,
- const GrIRect& devClipBounds,
- const GrIRect& devPathBounds) {
+ const SkIRect& devClipBounds,
+ const SkIRect& devPathBounds) {
GrDrawState::AutoViewMatrixRestore avmr;
if (!avmr.setIdentity(target->drawState())) {
return;
}
- GrRect rect;
+ SkRect rect;
if (devClipBounds.fTop < devPathBounds.fTop) {
rect.iset(devClipBounds.fLeft, devClipBounds.fTop,
devClipBounds.fRight, devPathBounds.fTop);
@@ -126,7 +126,7 @@
SkMatrix vm = drawState->getViewMatrix();
- GrIRect devPathBounds, devClipBounds;
+ SkIRect devPathBounds, devClipBounds;
if (!get_path_and_clip_bounds(target, path, vm,
&devPathBounds, &devClipBounds)) {
if (path.isInverseFillType()) {
diff --git a/src/gpu/GrStencilAndCoverPathRenderer.cpp b/src/gpu/GrStencilAndCoverPathRenderer.cpp
index 4f88acf..e8bc522 100644
--- a/src/gpu/GrStencilAndCoverPathRenderer.cpp
+++ b/src/gpu/GrStencilAndCoverPathRenderer.cpp
@@ -77,7 +77,7 @@
// fragment shaders be able to eat varyings generated by a matrix.
// fill the path, zero out the stencil
- GrRect bounds = p->getBounds();
+ SkRect bounds = p->getBounds();
SkScalar bloat = drawState->getViewMatrix().getMaxStretch() * SK_ScalarHalf;
GrDrawState::AutoViewMatrixRestore avmr;
diff --git a/src/gpu/GrTextContext.cpp b/src/gpu/GrTextContext.cpp
index c929d0c..c9e6d17 100644
--- a/src/gpu/GrTextContext.cpp
+++ b/src/gpu/GrTextContext.cpp
@@ -80,7 +80,7 @@
const GrClipData* clipData = context->getClip();
- GrRect devConservativeBound;
+ SkRect devConservativeBound;
clipData->fClipStack->getConservativeBounds(
-clipData->fOrigin.fX,
-clipData->fOrigin.fY,
diff --git a/src/gpu/GrTextStrike.cpp b/src/gpu/GrTextStrike.cpp
index 4b4298a..071c5d2 100644
--- a/src/gpu/GrTextStrike.cpp
+++ b/src/gpu/GrTextStrike.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2010 Google Inc.
*
@@ -6,14 +5,11 @@
* found in the LICENSE file.
*/
-
-
#include "GrAtlas.h"
#include "GrGpu.h"
#include "GrRectanizer.h"
#include "GrTextStrike.h"
#include "GrTextStrike_impl.h"
-#include "GrRect.h"
SK_DEFINE_INST_COUNT(GrFontScaler)
SK_DEFINE_INST_COUNT(GrKey)
@@ -159,7 +155,7 @@
GrGlyph* GrTextStrike::generateGlyph(GrGlyph::PackedID packed,
GrFontScaler* scaler) {
- GrIRect bounds;
+ SkIRect bounds;
if (!scaler->getPackedGlyphBounds(packed, &bounds)) {
return NULL;
}
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index ab7693c..81b25b8 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1280,8 +1280,8 @@
return;
}
- GrRect dstRect(srcRect);
- GrRect paintRect;
+ SkRect dstRect(srcRect);
+ SkRect paintRect;
SkScalar wInv = SkScalarInvert(SkIntToScalar(bitmap.width()));
SkScalar hInv = SkScalarInvert(SkIntToScalar(bitmap.height()));
paintRect.setLTRB(SkScalarMul(srcRect.fLeft, wInv),
@@ -1296,7 +1296,7 @@
srcRect.height() < bitmap.height();
if (m.rectStaysRect() && fContext->getMatrix().rectStaysRect()) {
// sampling is axis-aligned
- GrRect transformedRect;
+ SkRect transformedRect;
SkMatrix srcToDeviceMatrix(m);
srcToDeviceMatrix.postConcat(fContext->getMatrix());
srcToDeviceMatrix.mapRect(&transformedRect, srcRect);
@@ -1312,7 +1312,7 @@
}
}
- GrRect textureDomain = GrRect::MakeEmpty();
+ SkRect textureDomain = SkRect::MakeEmpty();
SkAutoTUnref<GrEffectRef> effect;
if (needsTextureDomain) {
// Use a constrained texture domain to avoid color bleeding
@@ -1405,11 +1405,11 @@
}
fContext->drawRectToRect(grPaint,
- GrRect::MakeXYWH(SkIntToScalar(left),
+ SkRect::MakeXYWH(SkIntToScalar(left),
SkIntToScalar(top),
SkIntToScalar(w),
SkIntToScalar(h)),
- GrRect::MakeXYWH(SkIntToScalar(offset.fX),
+ SkRect::MakeXYWH(SkIntToScalar(offset.fX),
SkIntToScalar(offset.fY),
SK_Scalar1 * w / texture->width(),
SK_Scalar1 * h / texture->height()));
@@ -1488,14 +1488,14 @@
return;
}
- GrRect dstRect = GrRect::MakeXYWH(SkIntToScalar(x),
+ SkRect dstRect = SkRect::MakeXYWH(SkIntToScalar(x),
SkIntToScalar(y),
SkIntToScalar(w),
SkIntToScalar(h));
// The device being drawn may not fill up its texture (e.g. saveLayer uses approximate
// scratch texture).
- GrRect srcRect = GrRect::MakeWH(SK_Scalar1 * w / devTex->width(),
+ SkRect srcRect = SkRect::MakeWH(SK_Scalar1 * w / devTex->width(),
SK_Scalar1 * h / devTex->height());
fContext->drawRectToRect(grPaint, dstRect, srcRect);
diff --git a/src/gpu/SkGrFontScaler.cpp b/src/gpu/SkGrFontScaler.cpp
index acecbd9..35be3d0 100644
--- a/src/gpu/SkGrFontScaler.cpp
+++ b/src/gpu/SkGrFontScaler.cpp
@@ -101,7 +101,7 @@
}
bool SkGrFontScaler::getPackedGlyphBounds(GrGlyph::PackedID packed,
- GrIRect* bounds) {
+ SkIRect* bounds) {
const SkGlyph& glyph = fStrike->getGlyphIDMetrics(GrGlyph::UnpackID(packed),
GrGlyph::UnpackFixedX(packed),
GrGlyph::UnpackFixedY(packed));
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index db6141f..d1c7fea 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -213,8 +213,8 @@
*pmToUPMRule = kConversionRules[i][0];
*upmToPMRule = kConversionRules[i][1];
- static const GrRect kDstRect = GrRect::MakeWH(SkIntToScalar(256), SkIntToScalar(256));
- static const GrRect kSrcRect = GrRect::MakeWH(SK_Scalar1, SK_Scalar1);
+ static const SkRect kDstRect = SkRect::MakeWH(SkIntToScalar(256), SkIntToScalar(256));
+ static const SkRect kSrcRect = SkRect::MakeWH(SK_Scalar1, SK_Scalar1);
// We do a PM->UPM draw from dataTex to readTex and read the data. Then we do a UPM->PM draw
// from readTex to tempTex followed by a PM->UPM draw to readTex and finally read the data.
// We then verify that two reads produced the same values.
diff --git a/src/gpu/effects/GrTextureDomainEffect.cpp b/src/gpu/effects/GrTextureDomainEffect.cpp
index dcfda28..96372d9 100644
--- a/src/gpu/effects/GrTextureDomainEffect.cpp
+++ b/src/gpu/effects/GrTextureDomainEffect.cpp
@@ -108,7 +108,7 @@
void GrGLTextureDomainEffect::setData(const GrGLUniformManager& uman,
const GrDrawEffect& drawEffect) {
const GrTextureDomainEffect& texDom = drawEffect.castEffect<GrTextureDomainEffect>();
- const GrRect& domain = texDom.domain();
+ const SkRect& domain = texDom.domain();
float values[4] = {
SkScalarToFloat(domain.left()),
@@ -151,7 +151,7 @@
GrEffectRef* GrTextureDomainEffect::Create(GrTexture* texture,
const SkMatrix& matrix,
- const GrRect& domain,
+ const SkRect& domain,
WrapMode wrapMode,
bool bilerp,
CoordsType coordsType) {
@@ -185,7 +185,7 @@
GrTextureDomainEffect::GrTextureDomainEffect(GrTexture* texture,
const SkMatrix& matrix,
- const GrRect& domain,
+ const SkRect& domain,
WrapMode wrapMode,
bool bilerp,
CoordsType coordsType)
@@ -226,7 +226,7 @@
GrTexture* textures[]) {
int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx :
GrEffectUnitTest::kAlphaTextureIdx;
- GrRect domain;
+ SkRect domain;
domain.fLeft = random->nextUScalar1();
domain.fRight = random->nextRangeScalar(domain.fLeft, SK_Scalar1);
domain.fTop = random->nextUScalar1();
diff --git a/src/gpu/effects/GrTextureDomainEffect.h b/src/gpu/effects/GrTextureDomainEffect.h
index 8b1f2b6..a4017c1 100644
--- a/src/gpu/effects/GrTextureDomainEffect.h
+++ b/src/gpu/effects/GrTextureDomainEffect.h
@@ -9,9 +9,9 @@
#define GrTextureDomainEffect_DEFINED
#include "GrSingleTextureEffect.h"
-#include "GrRect.h"
class GrGLTextureDomainEffect;
+struct SkRect;
/**
* Limits a texture's lookup coordinates to a domain. Samples outside the domain are either clamped
@@ -74,7 +74,7 @@
private:
GrTextureDomainEffect(GrTexture*,
const SkMatrix&,
- const GrRect& domain,
+ const SkRect& domain,
WrapMode,
bool bilerp,
CoordsType type);
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index 0ffcc272..cf6cf41 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -542,8 +542,8 @@
*rowBytes = *width * bpp;
}
- GrIRect subRect = GrIRect::MakeXYWH(*left, *top, *width, *height);
- GrIRect bounds = GrIRect::MakeWH(surfaceWidth, surfaceHeight);
+ SkIRect subRect = SkIRect::MakeXYWH(*left, *top, *width, *height);
+ SkIRect bounds = SkIRect::MakeWH(surfaceWidth, surfaceHeight);
if (!subRect.intersect(bounds)) {
return false;
@@ -1269,17 +1269,17 @@
}
}
-void GrGpuGL::onClear(const GrIRect* rect, GrColor color) {
+void GrGpuGL::onClear(const SkIRect* rect, GrColor color) {
const GrDrawState& drawState = this->getDrawState();
const GrRenderTarget* rt = drawState.getRenderTarget();
// parent class should never let us get here with no RT
GrAssert(NULL != rt);
- GrIRect clippedRect;
+ SkIRect clippedRect;
if (NULL != rect) {
// flushScissor expects rect to be clipped to the target.
clippedRect = *rect;
- GrIRect rtRect = SkIRect::MakeWH(rt->width(), rt->height());
+ SkIRect rtRect = SkIRect::MakeWH(rt->width(), rt->height());
if (clippedRect.intersect(rtRect)) {
rect = &clippedRect;
} else {
@@ -1313,7 +1313,7 @@
return;
}
- this->flushRenderTarget(&GrIRect::EmptyIRect());
+ this->flushRenderTarget(&SkIRect::EmptyIRect());
GrAutoTRestore<ScissorState> asr(&fScissorState);
fScissorState.fEnabled = false;
@@ -1325,7 +1325,7 @@
fHWStencilSettings.invalidate();
}
-void GrGpuGL::clearStencilClip(const GrIRect& rect, bool insideClip) {
+void GrGpuGL::clearStencilClip(const SkIRect& rect, bool insideClip) {
const GrDrawState& drawState = this->getDrawState();
const GrRenderTarget* rt = drawState.getRenderTarget();
GrAssert(NULL != rt);
@@ -1351,7 +1351,7 @@
} else {
value = 0;
}
- this->flushRenderTarget(&GrIRect::EmptyIRect());
+ this->flushRenderTarget(&SkIRect::EmptyIRect());
GrAutoTRestore<ScissorState> asr(&fScissorState);
fScissorState.fEnabled = true;
@@ -1365,7 +1365,7 @@
}
void GrGpuGL::onForceRenderTargetFlush() {
- this->flushRenderTarget(&GrIRect::EmptyIRect());
+ this->flushRenderTarget(&SkIRect::EmptyIRect());
}
bool GrGpuGL::readPixelsWillPayForYFlip(GrRenderTarget* renderTarget,
@@ -1427,7 +1427,7 @@
return false;
case GrGLRenderTarget::kAutoResolves_ResolveType:
artr.set(this->drawState(), target);
- this->flushRenderTarget(&GrIRect::EmptyIRect());
+ this->flushRenderTarget(&SkIRect::EmptyIRect());
break;
case GrGLRenderTarget::kCanResolve_ResolveType:
this->onResolveRenderTarget(tgt);
@@ -1522,7 +1522,7 @@
return true;
}
-void GrGpuGL::flushRenderTarget(const GrIRect* bound) {
+void GrGpuGL::flushRenderTarget(const SkIRect* bound) {
GrGLRenderTarget* rt =
static_cast<GrGLRenderTarget*>(this->drawState()->getRenderTarget());
@@ -1701,7 +1701,7 @@
// the bound DRAW FBO ID.
fHWBoundRenderTarget = NULL;
const GrGLIRect& vp = rt->getViewport();
- const GrIRect dirtyRect = rt->getResolveRect();
+ const SkIRect dirtyRect = rt->getResolveRect();
GrGLIRect r;
r.setRelativeTo(vp, dirtyRect.fLeft, dirtyRect.fTop,
dirtyRect.width(), dirtyRect.height(), target->origin());
diff --git a/src/gpu/gl/GrGpuGL.h b/src/gpu/gl/GrGpuGL.h
index 38e5842..b5ea2a7 100644
--- a/src/gpu/gl/GrGpuGL.h
+++ b/src/gpu/gl/GrGpuGL.h
@@ -5,12 +5,9 @@
* found in the LICENSE file.
*/
-
-
#ifndef GrGpuGL_DEFINED
#define GrGpuGL_DEFINED
-
#include "GrBinHashKey.h"
#include "GrDrawState.h"
#include "GrGpu.h"
@@ -121,7 +118,7 @@
GrStencilBuffer* sb,
GrRenderTarget* rt) SK_OVERRIDE;
- virtual void onClear(const GrIRect* rect, GrColor color) SK_OVERRIDE;
+ virtual void onClear(const SkIRect* rect, GrColor color) SK_OVERRIDE;
virtual void onForceRenderTargetFlush() SK_OVERRIDE;
@@ -148,7 +145,7 @@
virtual void onGpuStencilPath(const GrPath*, SkPath::FillType) SK_OVERRIDE;
virtual void clearStencil() SK_OVERRIDE;
- virtual void clearStencilClip(const GrIRect& rect,
+ virtual void clearStencilClip(const SkIRect& rect,
bool insideClip) SK_OVERRIDE;
virtual bool flushGraphicsState(DrawType, const GrDeviceCoordTexture* dstCopy) SK_OVERRIDE;
@@ -235,7 +232,7 @@
// bound is region that may be modified and therefore has to be resolved.
// NULL means whole target. Can be an empty rect.
- void flushRenderTarget(const GrIRect* bound);
+ void flushRenderTarget(const SkIRect* bound);
void flushStencil(DrawType);
void flushAAState(DrawType);
diff --git a/src/gpu/gl/GrGpuGL_program.cpp b/src/gpu/gl/GrGpuGL_program.cpp
index 5da8ecf..a61ca44 100644
--- a/src/gpu/gl/GrGpuGL_program.cpp
+++ b/src/gpu/gl/GrGpuGL_program.cpp
@@ -317,8 +317,8 @@
this->flushScissor();
this->flushAAState(type);
- GrIRect* devRect = NULL;
- GrIRect devClipBounds;
+ SkIRect* devRect = NULL;
+ SkIRect devClipBounds;
if (drawState.isClipState()) {
this->getClip()->getConservativeBounds(drawState.getRenderTarget(), &devClipBounds);
devRect = &devClipBounds;
diff --git a/tests/ClipCacheTest.cpp b/tests/ClipCacheTest.cpp
index 932fddb..c3801d7 100644
--- a/tests/ClipCacheTest.cpp
+++ b/tests/ClipCacheTest.cpp
@@ -105,13 +105,13 @@
const GrClipMaskCache& cache,
const SkClipStack& clip,
GrTexture* mask,
- const GrIRect& bound) {
+ const SkIRect& bound) {
SkClipStack cacheClip;
REPORTER_ASSERT(reporter, clip.getTopmostGenID() == cache.getLastClipGenID());
REPORTER_ASSERT(reporter, mask == cache.getLastMask());
- GrIRect cacheBound;
+ SkIRect cacheBound;
cache.getLastBound(&cacheBound);
REPORTER_ASSERT(reporter, bound == cacheBound);
}
@@ -131,14 +131,14 @@
SkClipStack emptyClip;
emptyClip.reset();
- GrIRect emptyBound;
+ SkIRect emptyBound;
emptyBound.setEmpty();
// check initial state
check_state(reporter, cache, emptyClip, NULL, emptyBound);
// set the current state
- GrIRect bound1;
+ SkIRect bound1;
bound1.set(0, 0, 100, 100);
SkClipStack clip1(bound1);
@@ -169,7 +169,7 @@
REPORTER_ASSERT(reporter, texture1->getRefCnt());
// modify the new state
- GrIRect bound2;
+ SkIRect bound2;
bound2.set(-10, -10, 10, 10);
SkClipStack clip2(bound2);