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/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*);