From 4c18e9fbb685cccf23342757e786027a032197da Mon Sep 17 00:00:00 2001 From: "skia.committer@gmail.com" Date: Fri, 31 Jan 2014 03:01:59 +0000 Subject: Sanitizing source files in Housekeeper-Nightly git-svn-id: http://skia.googlecode.com/svn/trunk@13258 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/effects/SkBlurMask.cpp | 6 +-- src/effects/SkBlurMask.h | 22 +++++----- src/effects/SkBlurMaskFilter.cpp | 76 +++++++++++++++++----------------- src/gpu/GrBitmapTextContext.cpp | 4 +- src/gpu/GrBitmapTextContext.h | 6 +-- src/gpu/GrDistanceFieldTextContext.cpp | 2 +- src/gpu/GrDistanceFieldTextContext.h | 6 +-- src/gpu/GrTextContext.h | 4 +- src/gpu/SkGpuDevice.cpp | 12 +++--- src/gpu/effects/GrConvexPolyEffect.cpp | 1 - src/gpu/effects/GrConvexPolyEffect.h | 2 +- src/utils/SkEventTracer.cpp | 10 ++--- 12 files changed, 75 insertions(+), 76 deletions(-) (limited to 'src') diff --git a/src/effects/SkBlurMask.cpp b/src/effects/SkBlurMask.cpp index f61536e65..50c16f415 100644 --- a/src/effects/SkBlurMask.cpp +++ b/src/effects/SkBlurMask.cpp @@ -717,7 +717,7 @@ uint8_t SkBlurMask::ProfileLookup(const uint8_t *profile, int loc, int blurred_w return profile[ox]; } -void SkBlurMask::ComputeBlurredScanline(uint8_t *pixels, const uint8_t *profile, +void SkBlurMask::ComputeBlurredScanline(uint8_t *pixels, const uint8_t *profile, unsigned int width, SkScalar sigma) { unsigned int profile_size = SkScalarCeilToInt(6*sigma); @@ -738,7 +738,7 @@ void SkBlurMask::ComputeBlurredScanline(uint8_t *pixels, const uint8_t *profile, float giX = 1.5f - (x+.5f)/(2*sigma); pixels[x] = (uint8_t) (255 * (gaussianIntegral(giX) - gaussianIntegral(giX + span))); } - } + } } bool SkBlurMask::BlurRect(SkMask *dst, const SkRect &src, @@ -802,7 +802,7 @@ bool SkBlurMask::BlurRect(SkScalar sigma, SkMask *dst, SkAutoTMalloc horizontalScanline(dstWidth); SkAutoTMalloc verticalScanline(dstHeight); - + ComputeBlurredScanline(horizontalScanline, profile, dstWidth, sigma); ComputeBlurredScanline(verticalScanline, profile, dstHeight, sigma); diff --git a/src/effects/SkBlurMask.h b/src/effects/SkBlurMask.h index f95c110c9..354fa84f6 100644 --- a/src/effects/SkBlurMask.h +++ b/src/effects/SkBlurMask.h @@ -62,27 +62,27 @@ public: SkIPoint* margin = NULL); static SkScalar ConvertRadiusToSigma(SkScalar radius); - + /* Helper functions for analytic rectangle blurs */ - + /** Look up the intensity of the (one dimnensional) blurred half-plane. @param profile The precomputed 1D blur profile; memory allocated by and managed by ComputeBlurProfile below. - @param loc the location to look up; The lookup will clamp invalid inputs, but + @param loc the location to look up; The lookup will clamp invalid inputs, but meaningful data are available between 0 and blurred_width @param blurred_width The width of the final, blurred rectangle @param sharp_width The width of the original, unblurred rectangle. - */ + */ static uint8_t ProfileLookup(const uint8_t* profile, int loc, int blurred_width, int sharp_width); - + /** Allocate memory for and populate the profile of a 1D blurred halfplane. The caller must free the memory. The amount of memory allocated will be exactly 6*sigma bytes. @param sigma The standard deviation of the gaussian blur kernel @param profile_out The location to store the allocated profile curve */ - + static void ComputeBlurProfile(SkScalar sigma, uint8_t** profile_out); - + /** Compute an entire scanline of a blurred step function. This is a 1D helper that will produce both the horizontal and vertical profiles of the blurry rectangle. @param pixels Location to store the resulting pixel data; allocated and managed by caller @@ -91,12 +91,12 @@ public: @param sigma Standard deviation of the gaussian blur kernel used to compute the profile; this implicitly gives the size of the pixels array. */ - + static void ComputeBlurredScanline(uint8_t* pixels, const uint8_t* profile, unsigned int width, SkScalar sigma); - - - + + + }; #endif diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp index 03eedd29a..5cb98153f 100644 --- a/src/effects/SkBlurMaskFilter.cpp +++ b/src/effects/SkBlurMaskFilter.cpp @@ -525,36 +525,36 @@ public: /** * Create a simple filter effect with custom bicubic coefficients. */ - static GrEffectRef* Create(GrContext *context, const SkRect& rect, + static GrEffectRef* Create(GrContext *context, const SkRect& rect, float sigma) { GrTexture *horizontalScanline, *verticalScanline; - bool createdScanlines = CreateScanlineTextures(context, sigma, + bool createdScanlines = CreateScanlineTextures(context, sigma, SkScalarCeilToInt(rect.width()), SkScalarCeilToInt(rect.height()), &horizontalScanline, &verticalScanline); if (!createdScanlines) { return NULL; } - AutoEffectUnref effect(SkNEW_ARGS(GrRectBlurEffect, (rect, sigma, + AutoEffectUnref effect(SkNEW_ARGS(GrRectBlurEffect, (rect, sigma, horizontalScanline, verticalScanline))); - return CreateEffectRef(effect); + return CreateEffectRef(effect); } - + unsigned int getWidth() const { return fWidth; } unsigned int getHeight() const { return fHeight; } float getSigma() const { return fSigma; } const GrCoordTransform& getTransform() const { return fTransform; } private: - GrRectBlurEffect(const SkRect& rect, float sigma, + GrRectBlurEffect(const SkRect& rect, float sigma, GrTexture *horizontal_scanline, GrTexture *vertical_scanline); virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE; - + static bool CreateScanlineTextures(GrContext *context, float sigma, unsigned int width, unsigned int height, GrTexture **horizontalScanline, GrTexture **verticalScanline); - + unsigned int fWidth, fHeight; float fSigma; GrTextureAccess fHorizontalScanlineAccess; @@ -600,22 +600,22 @@ void GrGLRectBlurEffect::emitCode(GrGLShaderBuilder* builder, const char* inputColor, const TransformedCoordsArray& coords, const TextureSamplerArray& samplers) { - + SkString texture_coords = builder->ensureFSCoords2D(coords, 0); - + if (inputColor) { builder->fsCodeAppendf("\tvec4 src=%s;\n", inputColor); } else { builder->fsCodeAppendf("\tvec4 src=vec4(1)\n;"); } - + builder->fsCodeAppendf("\tvec4 horiz = "); builder->fsAppendTextureLookup( samplers[0], texture_coords.c_str() ); builder->fsCodeAppendf(";\n"); builder->fsCodeAppendf("\tvec4 vert = "); builder->fsAppendTextureLookup( samplers[1], texture_coords.c_str() ); builder->fsCodeAppendf(";\n"); - + builder->fsCodeAppendf("\tfloat final = (horiz*vert).r;\n"); builder->fsCodeAppendf("\t%s = final*src;\n", outputColor); } @@ -630,13 +630,13 @@ bool GrRectBlurEffect::CreateScanlineTextures(GrContext *context, float sigma, GrTexture **verticalScanline) { GrTextureParams params; GrTextureDesc texDesc; - + unsigned int profile_size = SkScalarFloorToInt(6*sigma); - + texDesc.fWidth = width; texDesc.fHeight = 1; texDesc.fConfig = kAlpha_8_GrPixelConfig; - + static const GrCacheID::Domain gBlurProfileDomain = GrCacheID::GenerateDomain(); GrCacheID::Key key; memset(&key, 0, sizeof(key)); @@ -644,58 +644,58 @@ bool GrRectBlurEffect::CreateScanlineTextures(GrContext *context, float sigma, key.fData32[1] = width; key.fData32[2] = 1; GrCacheID horizontalCacheID(gBlurProfileDomain, key); - + uint8_t *profile = NULL; SkAutoTDeleteArray ada(NULL); - + *horizontalScanline = context->findAndRefTexture(texDesc, horizontalCacheID, ¶ms); - + if (NULL == *horizontalScanline) { - + SkBlurMask::ComputeBlurProfile(sigma, &profile); ada.reset(profile); - + SkAutoTMalloc horizontalPixels(width); SkBlurMask::ComputeBlurredScanline(horizontalPixels, profile, width, sigma); - - *horizontalScanline = context->createTexture(¶ms, texDesc, horizontalCacheID, + + *horizontalScanline = context->createTexture(¶ms, texDesc, horizontalCacheID, horizontalPixels, 0); - + if (NULL == *horizontalScanline) { return false; } } - + texDesc.fWidth = 1; texDesc.fHeight = height; key.fData32[1] = 1; key.fData32[2] = height; GrCacheID verticalCacheID(gBlurProfileDomain, key); - + *verticalScanline = context->findAndRefTexture(texDesc, verticalCacheID, ¶ms); if (NULL == *verticalScanline) { if (NULL == profile) { SkBlurMask::ComputeBlurProfile(sigma, &profile); ada.reset(profile); } - + SkAutoTMalloc verticalPixels(height); SkBlurMask::ComputeBlurredScanline(verticalPixels, profile, height, sigma); - - *verticalScanline = context->createTexture(¶ms, texDesc, verticalCacheID, + + *verticalScanline = context->createTexture(¶ms, texDesc, verticalCacheID, verticalPixels, 0); - + if (NULL == *verticalScanline) { return false; } - + } return true; } GrRectBlurEffect::GrRectBlurEffect(const SkRect& rect, float sigma, GrTexture *horizontal_scanline, GrTexture *vertical_scanline) - : INHERITED(), + : INHERITED(), fWidth(horizontal_scanline->width()), fHeight(vertical_scanline->width()), fSigma(sigma), @@ -704,8 +704,8 @@ GrRectBlurEffect::GrRectBlurEffect(const SkRect& rect, float sigma, SkMatrix mat; mat.setRectToRect(rect, SkRect::MakeWH(1,1), SkMatrix::kFill_ScaleToFit); fTransform.reset(kLocal_GrCoordSet, mat); - this->addTextureAccess(&fHorizontalScanlineAccess); - this->addTextureAccess(&fVerticalScanlineAccess); + this->addTextureAccess(&fHorizontalScanlineAccess); + this->addTextureAccess(&fVerticalScanlineAccess); this->addCoordTransform(&fTransform); } @@ -749,20 +749,20 @@ bool SkBlurMaskFilterImpl::directFilterMaskGPU(GrContext* context, if (fBlurStyle != SkBlurMaskFilter::kNormal_BlurStyle) { return false; } - + SkRect rect; if (!path.isRect(&rect)) { return false; } - + if (!strokeRec.isFillStyle()) { return false; } - + SkMatrix ctm = context->getMatrix(); SkScalar xformedSigma = this->computeXformedSigma(ctm); rect.outset(3*xformedSigma, 3*xformedSigma); - + SkAutoTUnref effect(GrRectBlurEffect::Create( context, rect, xformedSigma)); if (!effect) { @@ -776,7 +776,7 @@ bool SkBlurMaskFilterImpl::directFilterMaskGPU(GrContext* context, grp->addCoverageEffect(effect); - + context->drawRect(*grp, rect); return true; } diff --git a/src/gpu/GrBitmapTextContext.cpp b/src/gpu/GrBitmapTextContext.cpp index c7beb14e4..79309f3f4 100755 --- a/src/gpu/GrBitmapTextContext.cpp +++ b/src/gpu/GrBitmapTextContext.cpp @@ -133,7 +133,7 @@ inline void GrBitmapTextContext::finish() { GrTextContext::finish(); } -void GrBitmapTextContext::drawText(const GrPaint& paint, const SkPaint& skPaint, +void GrBitmapTextContext::drawText(const GrPaint& paint, const SkPaint& skPaint, const char text[], size_t byteLength, SkScalar x, SkScalar y) { SkASSERT(byteLength == 0 || text != NULL); @@ -316,7 +316,7 @@ BitmapTextMapState::Proc BitmapTextMapState::pickProc(int scalarsPerPosition) { /////////////////////////////////////////////////////////////////////////////// -void GrBitmapTextContext::drawPosText(const GrPaint& paint, const SkPaint& skPaint, +void GrBitmapTextContext::drawPosText(const GrPaint& paint, const SkPaint& skPaint, const char text[], size_t byteLength, const SkScalar pos[], SkScalar constY, int scalarsPerPosition) { diff --git a/src/gpu/GrBitmapTextContext.h b/src/gpu/GrBitmapTextContext.h index 8d6edda92..5817359b7 100755 --- a/src/gpu/GrBitmapTextContext.h +++ b/src/gpu/GrBitmapTextContext.h @@ -20,15 +20,15 @@ public: GrBitmapTextContext(GrContext*, const SkDeviceProperties&); virtual ~GrBitmapTextContext(); - virtual void drawText(const GrPaint&, const SkPaint&, const char text[], size_t byteLength, + virtual void drawText(const GrPaint&, const SkPaint&, const char text[], size_t byteLength, SkScalar x, SkScalar y) SK_OVERRIDE; - virtual void drawPosText(const GrPaint&, const SkPaint&, + virtual void drawPosText(const GrPaint&, const SkPaint&, const char text[], size_t byteLength, const SkScalar pos[], SkScalar constY, int scalarsPerPosition) SK_OVERRIDE; virtual bool canDraw(const SkPaint& paint) SK_OVERRIDE; - + private: GrTextStrike* fStrike; diff --git a/src/gpu/GrDistanceFieldTextContext.cpp b/src/gpu/GrDistanceFieldTextContext.cpp index ac9343320..bd3927c64 100755 --- a/src/gpu/GrDistanceFieldTextContext.cpp +++ b/src/gpu/GrDistanceFieldTextContext.cpp @@ -294,7 +294,7 @@ inline void GrDistanceFieldTextContext::init(const GrPaint& paint, const SkPaint fMaxVertices = 0; fTextRatio = fSkPaint.getTextSize()/kBaseDFFontSize; - + fSkPaint.setTextSize(SkIntToScalar(kBaseDFFontSize)); fSkPaint.setLCDRenderText(false); fSkPaint.setAutohinted(false); diff --git a/src/gpu/GrDistanceFieldTextContext.h b/src/gpu/GrDistanceFieldTextContext.h index 212989890..63fe8efcb 100755 --- a/src/gpu/GrDistanceFieldTextContext.h +++ b/src/gpu/GrDistanceFieldTextContext.h @@ -20,13 +20,13 @@ public: GrDistanceFieldTextContext(GrContext*, const SkDeviceProperties&); virtual ~GrDistanceFieldTextContext(); - virtual void drawText(const GrPaint&, const SkPaint&, const char text[], size_t byteLength, + virtual void drawText(const GrPaint&, const SkPaint&, const char text[], size_t byteLength, SkScalar x, SkScalar y) SK_OVERRIDE; - virtual void drawPosText(const GrPaint&, const SkPaint&, + virtual void drawPosText(const GrPaint&, const SkPaint&, const char text[], size_t byteLength, const SkScalar pos[], SkScalar constY, int scalarsPerPosition) SK_OVERRIDE; - + virtual bool canDraw(const SkPaint& paint) SK_OVERRIDE; private: diff --git a/src/gpu/GrTextContext.h b/src/gpu/GrTextContext.h index ea089cc76..4cede1dd9 100644 --- a/src/gpu/GrTextContext.h +++ b/src/gpu/GrTextContext.h @@ -25,7 +25,7 @@ class GrFontScaler; class GrTextContext { public: virtual ~GrTextContext() {} - virtual void drawText(const GrPaint&, const SkPaint&, const char text[], size_t byteLength, + virtual void drawText(const GrPaint&, const SkPaint&, const char text[], size_t byteLength, SkScalar x, SkScalar y) = 0; virtual void drawPosText(const GrPaint&, const SkPaint&, const char text[], size_t byteLength, @@ -33,7 +33,7 @@ public: int scalarsPerPosition) = 0; virtual bool canDraw(const SkPaint& paint) = 0; - + protected: GrTextContext(GrContext*, const SkDeviceProperties&); diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index dfae1c4a4..da56009c5 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -938,7 +938,7 @@ void SkGpuDevice::drawPath(const SkDraw& draw, const SkPath& origSrcPath, // transform the path into device space pathPtr->transform(fContext->getMatrix(), devPathPtr); - + SkRect maskRect; if (paint.getMaskFilter()->canFilterMaskGPU(devPathPtr->getBounds(), draw.fClip->getBounds(), @@ -958,7 +958,7 @@ void SkGpuDevice::drawPath(const SkDraw& draw, const SkPath& origSrcPath, // nothing to draw return; } - + if (paint.getMaskFilter()->directFilterMaskGPU(fContext, &grPaint, SkStrokeRec(paint), *devPathPtr)) { // the mask filter was able to draw itself directly, so there's nothing @@ -1821,17 +1821,17 @@ void SkGpuDevice::drawPosText(const SkDraw& draw, const void* text, SkDEBUGCODE(this->validate();) - fMainTextContext->drawPosText(grPaint, paint, (const char *)text, byteLength, pos, + fMainTextContext->drawPosText(grPaint, paint, (const char *)text, byteLength, pos, constY, scalarsPerPos); } else if (fFallbackTextContext && fFallbackTextContext->canDraw(paint)) { GrPaint grPaint; if (!skPaint2GrPaintShader(this, paint, true, &grPaint)) { return; } - + SkDEBUGCODE(this->validate();) - - fFallbackTextContext->drawPosText(grPaint, paint, (const char *)text, byteLength, pos, + + fFallbackTextContext->drawPosText(grPaint, paint, (const char *)text, byteLength, pos, constY, scalarsPerPos); } else { draw.drawPosText_asPaths((const char*)text, byteLength, pos, constY, diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp index d780e2833..4616bdb7a 100644 --- a/src/gpu/effects/GrConvexPolyEffect.cpp +++ b/src/gpu/effects/GrConvexPolyEffect.cpp @@ -182,4 +182,3 @@ GrEffectRef* GrConvexPolyEffect::TestCreate(SkRandom* random, return GrConvexPolyEffect::Create(edgeType, count, edges); } - diff --git a/src/gpu/effects/GrConvexPolyEffect.h b/src/gpu/effects/GrConvexPolyEffect.h index 8390e149b..035d9e95d 100644 --- a/src/gpu/effects/GrConvexPolyEffect.h +++ b/src/gpu/effects/GrConvexPolyEffect.h @@ -27,7 +27,7 @@ public: enum EdgeType { kFillNoAA_EdgeType, kFillAA_EdgeType, - + kLastEdgeType = kFillAA_EdgeType, }; diff --git a/src/utils/SkEventTracer.cpp b/src/utils/SkEventTracer.cpp index e00c3e318..f9e72de6b 100644 --- a/src/utils/SkEventTracer.cpp +++ b/src/utils/SkEventTracer.cpp @@ -9,7 +9,7 @@ #include "SkOnce.h" class SkDefaultEventTracer: public SkEventTracer { - virtual SkEventTracer::Handle + virtual SkEventTracer::Handle addTraceEvent(char phase, const uint8_t* categoryEnabledFlag, const char* name, @@ -19,10 +19,10 @@ class SkDefaultEventTracer: public SkEventTracer { const uint8_t* argTypes, const uint64_t* argValues, uint8_t flags) SK_OVERRIDE { return 0; } - - virtual void - updateTraceEventDuration(const uint8_t* categoryEnabledFlag, - const char* name, + + virtual void + updateTraceEventDuration(const uint8_t* categoryEnabledFlag, + const char* name, SkEventTracer::Handle) SK_OVERRIDE {}; virtual const uint8_t* getCategoryGroupEnabled(const char* name) SK_OVERRIDE { -- cgit v1.2.3