diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-17 21:39:42 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-17 21:39:42 +0000 |
commit | fd03d4a829efe2d77a712fd991927c55f59a2ffe (patch) | |
tree | b207777f1e3fe70b5823a2bc166a75c71f311036 /src | |
parent | 5dd567c2a55c16c8bc2668902cdfce1734dfae8f (diff) |
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
Diffstat (limited to 'src')
36 files changed, 147 insertions, 167 deletions
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp index 4783abdce9..ab3458c55e 100644 --- a/src/effects/SkMorphologyImageFilter.cpp +++ b/src/effects/SkMorphologyImageFilter.cpp @@ -469,7 +469,7 @@ GrTexture* apply_morphology(GrTexture* srcTexture, 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 1895da9891..67c2a32863 100644 --- a/src/gpu/GrAAHairLinePathRenderer.cpp +++ b/src/gpu/GrAAHairLinePathRenderer.cpp @@ -251,7 +251,7 @@ int num_quad_subdivs(const SkPoint p[3]) { */ 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 @@ int generate_lines_and_quads(const SkPath& path, SkPath::Iter iter(path, false); int totalQuadCount = 0; - GrRect bounds; - GrIRect ibounds; + SkRect bounds; + SkIRect ibounds; bool persp = m.hasPerspective(); @@ -986,7 +986,7 @@ bool GrAAHairLinePathRenderer::createGeom( 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 5b10e95fb2..3a6ff3036c 100644 --- a/src/gpu/GrAARectRenderer.cpp +++ b/src/gpu/GrAARectRenderer.cpp @@ -277,7 +277,7 @@ static void set_aa_rect_vertex_attributes(GrDrawState* drawState, bool useCovera } 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 @@ GrIndexBuffer* GrAARectRenderer::aaStrokeRectIndexBuffer(GrGpu* gpu) { 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 @@ extern const GrVertexAttrib gAAAARectVertexAttribs[] = { 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::shaderFillAARect(GrGpu* gpu, 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::shaderFillAlignedAARect(GrGpu* gpu, 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 @@ void GrAARectRenderer::strokeAARect(GrGpu* gpu, 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 ce9dcdf44f..22b43710f8 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 9a091c4b3a..330a1f215f 100644 --- a/src/gpu/GrClipMaskCache.h +++ b/src/gpu/GrClipMaskCache.h @@ -118,7 +118,7 @@ public: void acquireMask(int32_t clipGenID, const GrTextureDesc& desc, - const GrIRect& bound) { + const SkIRect& bound) { if (fStack.empty()) { GrAssert(false); @@ -162,7 +162,7 @@ public: return back->fLastMask.texture()->height(); } - void getLastBound(GrIRect* bound) const { + void getLastBound(SkIRect* bound) const { if (fStack.empty()) { GrAssert(false); @@ -203,7 +203,7 @@ private: void acquireMask(GrContext* context, int32_t clipGenID, const GrTextureDesc& desc, - const GrIRect& bound) { + const SkIRect& bound) { fLastClipGenID = clipGenID; @@ -227,7 +227,7 @@ private: 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 bc20c2542f..faeac27c94 100644 --- a/src/gpu/GrClipMaskManager.cpp +++ b/src/gpu/GrClipMaskManager.cpp @@ -33,7 +33,7 @@ namespace { // 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 @@ bool GrClipMaskManager::canStencilAndDrawElement(GrTexture* target, 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 @@ GrTexture* GrClipMaskManager::createAlphaClipMask(int32_t clipStackGenID, // 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 121737b897..2cba4776d9 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 @@ private: 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 f4b71aef21..ee8d9f7048 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -575,7 +575,7 @@ bool GrContext::supportsIndex8PixelConfig(const GrTextureParams* params, //////////////////////////////////////////////////////////////////////////////// -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::clear(const GrIRect* rect, 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 @@ inline bool disable_coverage_aa_for_blend(GrDrawTarget* target) { 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 @@ static void setStrokeRectStrip(GrPoint verts[10], GrRect rect, 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 @@ static bool apply_aa_to_rect(GrDrawTarget* target, } 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 @@ void GrContext::drawRect(const GrPaint& paint, 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::drawRect(const GrPaint& paint, } 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::drawRRect(const GrPaint& paint, /////////////////////////////////////////////////////////////////////////////// void GrContext::drawOval(const GrPaint& paint, - const GrRect& oval, + const SkRect& oval, const SkStrokeRec& stroke) { AutoRestoreEffects are; @@ -1319,7 +1319,7 @@ bool GrContext::readRenderTargetPixels(GrRenderTarget* target, 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 @@ bool GrContext::writeRenderTargetPixels(GrRenderTarget* target, 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 19fd2beff8..6d16fb63fe 100644 --- a/src/gpu/GrDefaultPathRenderer.cpp +++ b/src/gpu/GrDefaultPathRenderer.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * @@ -461,7 +460,7 @@ bool GrDefaultPathRenderer::internalDrawPath(const SkPath& path, 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 c4f872608b..1a67bb1ab0 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 1f3b630f01..9fdb0f4e35 100644 --- a/src/gpu/GrDrawTarget.cpp +++ b/src/gpu/GrDrawTarget.cpp @@ -420,7 +420,7 @@ bool GrDrawTarget::setupDstReadIfNecessary(DrawInfo* info) { 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 set_vertex_attributes(GrDrawState* drawState, bool hasUVs) { }; -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 f31dd6cd28..0c2b568da4 100644 --- a/src/gpu/GrDrawTarget.h +++ b/src/gpu/GrDrawTarget.h @@ -343,9 +343,9 @@ public: * 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 @@ public: /** * 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 @@ public: * 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 @@ private: // 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 5d6c62fc93..c4d8318ca1 100644 --- a/src/gpu/GrGpu.cpp +++ b/src/gpu/GrGpu.cpp @@ -203,7 +203,7 @@ GrPath* GrGpu::createPath(const SkPath& path) { 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 85e398807b..86c25ee72f 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 GrStencilBuffer; class GrVertexBufferAllocPool; class GrGpu : public GrDrawTarget { - public: /** @@ -269,7 +264,7 @@ public: 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 @@ public: * 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 @@ public: // 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 @@ protected: // 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 @@ private: // 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 dde66c5caf..3ec95966d8 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 @@ static void set_vertex_attributes(GrDrawState* drawState, }; -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 @@ void GrInOrderDrawBuffer::onStencilPath(const GrPath* path, const SkStrokeRec& s 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 0871cc53f7..6512dccf0d 100644 --- a/src/gpu/GrInOrderDrawBuffer.h +++ b/src/gpu/GrInOrderDrawBuffer.h @@ -69,7 +69,7 @@ public: // 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 @@ private: Clear() : fRenderTarget(NULL) {} ~Clear() { GrSafeUnref(fRenderTarget); } - GrIRect fRect; + SkIRect fRect; GrColor fColor; GrRenderTarget* fRenderTarget; }; @@ -122,9 +122,9 @@ private: // 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 85526dc6b3..6ea922c28b 100644 --- a/src/gpu/GrOvalRenderer.cpp +++ b/src/gpu/GrOvalRenderer.cpp @@ -291,7 +291,7 @@ void GrOvalRenderer::reset() { } 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 @@ extern const GrVertexAttrib gCircleVertexAttribs[] = { void GrOvalRenderer::drawCircle(GrDrawTarget* target, bool useAA, - const GrRect& circle, + const SkRect& circle, const SkStrokeRec& stroke) { GrDrawState* drawState = target->drawState(); @@ -432,7 +432,7 @@ extern const GrVertexAttrib gEllipseVertexAttribs[] = { 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 ad3a5c30e0..c7e7f92064 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 @@ public: 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 f6cd26b94f..f169455b4a 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 2d6045e00c..fc319ec50d 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 @@ class SkMatrix; 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 44d14a1c03..bacf4fddac 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 1cbd5f5e84..f55859636f 100644 --- a/src/gpu/GrRenderTarget.cpp +++ b/src/gpu/GrRenderTarget.cpp @@ -70,7 +70,7 @@ size_t GrRenderTarget::sizeInBytes() const { 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::flagAsNeedingResolve(const GrIRect* rect) { } } -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 c9f3989ebb..3f9251c394 100644 --- a/src/gpu/GrSWMaskHelper.cpp +++ b/src/gpu/GrSWMaskHelper.cpp @@ -37,7 +37,7 @@ SkXfermode::Mode op_to_mode(SkRegion::Op op) { /** * 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 @@ void GrSWMaskHelper::draw(const SkPath& path, const SkStrokeRec& stroke, SkRegio 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 @@ bool GrSWMaskHelper::init(const GrIRect& resultBounds, // 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 @@ void GrSWMaskHelper::toTexture(GrTexture *texture, uint8_t alpha) { 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 @@ GrTexture* GrSWMaskHelper::DrawPathMaskToTexture(GrContext* context, void GrSWMaskHelper::DrawToTargetWithPathMask(GrTexture* texture, GrDrawTarget* target, - const GrIRect& rect) { + const SkIRect& rect) { GrDrawState* drawState = target->drawState(); GrDrawState::AutoViewMatrixRestore avmr; @@ -193,11 +193,10 @@ void GrSWMaskHelper::DrawToTargetWithPathMask(GrTexture* texture, } 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 daf3111d55..ce5ae28a04 100644 --- a/src/gpu/GrSWMaskHelper.h +++ b/src/gpu/GrSWMaskHelper.h @@ -48,10 +48,10 @@ public: // 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 @@ public: 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 @@ public: // 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 21adc625dd..d0936d6b28 100644 --- a/src/gpu/GrSoftwarePathRenderer.cpp +++ b/src/gpu/GrSoftwarePathRenderer.cpp @@ -29,9 +29,9 @@ bool GrSoftwarePathRenderer::canDrawPath(const SkPath&, } 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 @@ namespace { 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 @@ bool get_path_and_clip_bounds(const GrDrawTarget* target, } 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 @@ bool get_path_and_clip_bounds(const GrDrawTarget* target, return false; } } else { - *devPathBounds = GrIRect::EmptyIRect(); + *devPathBounds = SkIRect::EmptyIRect(); return false; } return true; @@ -80,13 +80,13 @@ bool get_path_and_clip_bounds(const GrDrawTarget* target, //////////////////////////////////////////////////////////////////////////////// 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 @@ bool GrSoftwarePathRenderer::onDrawPath(const SkPath& path, 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 4f88acf418..e8bc522853 100644 --- a/src/gpu/GrStencilAndCoverPathRenderer.cpp +++ b/src/gpu/GrStencilAndCoverPathRenderer.cpp @@ -77,7 +77,7 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const SkPath& path, // 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 c929d0c56c..c9e6d17ba3 100644 --- a/src/gpu/GrTextContext.cpp +++ b/src/gpu/GrTextContext.cpp @@ -80,7 +80,7 @@ GrTextContext::GrTextContext(GrContext* context, const GrPaint& paint) : fPaint( 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 4b4298a96c..071c5d2724 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 @@ GrTextStrike::~GrTextStrike() { 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 ab7693c7f1..81b25b82b3 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -1280,8 +1280,8 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap, 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 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap, 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 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap, } } - 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 @@ void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap, } 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 @@ void SkGpuDevice::drawDevice(const SkDraw& draw, SkDevice* device, 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 acecbd955a..35be3d0489 100644 --- a/src/gpu/SkGrFontScaler.cpp +++ b/src/gpu/SkGrFontScaler.cpp @@ -101,7 +101,7 @@ const GrKey* SkGrFontScaler::getKey() { } 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 db6141f8e9..d1c7fea16d 100644 --- a/src/gpu/effects/GrConfigConversionEffect.cpp +++ b/src/gpu/effects/GrConfigConversionEffect.cpp @@ -213,8 +213,8 @@ void GrConfigConversionEffect::TestForPreservingPMConversions(GrContext* context *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 dcfda287ff..96372d926f 100644 --- a/src/gpu/effects/GrTextureDomainEffect.cpp +++ b/src/gpu/effects/GrTextureDomainEffect.cpp @@ -108,7 +108,7 @@ void GrGLTextureDomainEffect::emitCode(GrGLShaderBuilder* builder, 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 @@ GrGLEffect::EffectKey GrGLTextureDomainEffect::GenKey(const GrDrawEffect& drawEf GrEffectRef* GrTextureDomainEffect::Create(GrTexture* texture, const SkMatrix& matrix, - const GrRect& domain, + const SkRect& domain, WrapMode wrapMode, bool bilerp, CoordsType coordsType) { @@ -185,7 +185,7 @@ GrEffectRef* GrTextureDomainEffect::Create(GrTexture* texture, GrTextureDomainEffect::GrTextureDomainEffect(GrTexture* texture, const SkMatrix& matrix, - const GrRect& domain, + const SkRect& domain, WrapMode wrapMode, bool bilerp, CoordsType coordsType) @@ -226,7 +226,7 @@ GrEffectRef* GrTextureDomainEffect::TestCreate(SkMWCRandom* random, 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 8b1f2b6f61..a4017c1881 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 @@ protected: 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 0ffcc27222..cf6cf413e7 100644 --- a/src/gpu/gl/GrGpuGL.cpp +++ b/src/gpu/gl/GrGpuGL.cpp @@ -542,8 +542,8 @@ bool adjust_pixel_ops_params(int surfaceWidth, *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::flushScissor() { } } -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 @@ void GrGpuGL::clearStencil() { return; } - this->flushRenderTarget(&GrIRect::EmptyIRect()); + this->flushRenderTarget(&SkIRect::EmptyIRect()); GrAutoTRestore<ScissorState> asr(&fScissorState); fScissorState.fEnabled = false; @@ -1325,7 +1325,7 @@ void GrGpuGL::clearStencil() { 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 @@ void GrGpuGL::clearStencilClip(const GrIRect& rect, bool insideClip) { } else { value = 0; } - this->flushRenderTarget(&GrIRect::EmptyIRect()); + this->flushRenderTarget(&SkIRect::EmptyIRect()); GrAutoTRestore<ScissorState> asr(&fScissorState); fScissorState.fEnabled = true; @@ -1365,7 +1365,7 @@ void GrGpuGL::clearStencilClip(const GrIRect& rect, bool insideClip) { } void GrGpuGL::onForceRenderTargetFlush() { - this->flushRenderTarget(&GrIRect::EmptyIRect()); + this->flushRenderTarget(&SkIRect::EmptyIRect()); } bool GrGpuGL::readPixelsWillPayForYFlip(GrRenderTarget* renderTarget, @@ -1427,7 +1427,7 @@ bool GrGpuGL::onReadPixels(GrRenderTarget* target, 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 @@ bool GrGpuGL::onReadPixels(GrRenderTarget* target, 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 @@ void GrGpuGL::onResolveRenderTarget(GrRenderTarget* target) { // 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 38e5842dce..b5ea2a7be5 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 @@ private: 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 @@ private: 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 @@ private: // 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 5da8ecffbd..a61ca4443a 100644 --- a/src/gpu/gl/GrGpuGL_program.cpp +++ b/src/gpu/gl/GrGpuGL_program.cpp @@ -317,8 +317,8 @@ bool GrGpuGL::flushGraphicsState(DrawType type, const GrDeviceCoordTexture* dstC 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; |