Sanitizing source files in Skia_Periodic_House_Keeping

git-svn-id: http://skia.googlecode.com/svn/trunk@5943 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
skia.committer@gmail.com 2012-10-13 02:01:56 +00:00
parent e5877e6d9c
commit f57c01bdcf
11 changed files with 32 additions and 32 deletions

View File

@ -54,7 +54,7 @@ public:
fBitmap.setIsOpaque(true);
fBitmap.eraseColor(SK_ColorBLACK);
drawIntoBitmap(fBitmap);
fSrcR.set(0, 0, w, h);
fDstR.set(0, 0, w, h);
}

View File

@ -71,7 +71,7 @@ protected:
virtual SkISize onISize() { return SkISize::Make(400, 100); }
virtual void onDraw(SkCanvas* canvas) {
SkRect r = SkRect::MakeWH(FILTER_WIDTH, FILTER_HEIGHT);
SkPaint paint;
paint.setColor(SK_ColorRED);

View File

@ -23,7 +23,7 @@ static void makebm(SkBitmap* bm, SkBitmap::Config config, int w, int h) {
static const SkScalar kPos[] = { 0, SK_Scalar1/2, SK_Scalar1 };
static const SkColor kColors0[] = {0x80F00080, 0xF0F08000, 0x800080F0 };
static const SkColor kColors1[] = {0xF08000F0, 0x8080F000, 0xF000F080 };
SkPaint paint;
@ -71,7 +71,7 @@ protected:
if (bmp.isNull()) {
makebm(&bmp, SkBitmap::kARGB_8888_Config, kPointSize / 4, kPointSize / 4);
}
SkPaint bmpPaint;
bmpPaint.setAntiAlias(true);
bmpPaint.setFilterBitmap(true);
@ -83,9 +83,9 @@ protected:
outlinePaint.setTextSize(SkIntToScalar(kPointSize));
outlinePaint.setStyle(SkPaint::kStroke_Style);
outlinePaint.setStrokeWidth(0.f);
canvas->translate(15.f, 15.f);
// draw glyphs scaled up
canvas->scale(2.f, 2.f);
@ -93,13 +93,13 @@ protected:
SkShader::kRepeat_TileMode,
SkShader::kMirror_TileMode,
};
// position the baseline of the first run
canvas->translate(0.f, 0.75f * kPointSize);
canvas->save();
int i = 0;
for (size_t tm0 = 0; tm0 < SK_ARRAY_COUNT(kTileModes); ++tm0) {
for (size_t tm0 = 0; tm0 < SK_ARRAY_COUNT(kTileModes); ++tm0) {
for (size_t tm1 = 0; tm1 < SK_ARRAY_COUNT(kTileModes); ++tm1) {
SkAutoTUnref<SkShader> shader(SkShader::CreateBitmapShader(bmp,
kTileModes[tm0],

View File

@ -695,7 +695,7 @@ public:
GrAssert(NULL != context);
this->restore();
fContext = context;
fMatrix = context->getMatrix();
this->preConcat(preConcat, paint);
@ -709,7 +709,7 @@ public:
GrAssert(NULL != context);
this->restore();
if (NULL != paint) {
if (!paint->preConcatSamplerMatricesWithInverse(context->getMatrix())) {
return false;

View File

@ -244,7 +244,7 @@ static void Clamp_S32_D32_nofilter_trans_shaderproc(const SkBitmapProcState& s,
SkASSERT(s.fInvKy == 0);
SkASSERT(count > 0 && colors != NULL);
SkASSERT(!s.fDoFilter);
const int maxX = s.fBitmap->width() - 1;
const int maxY = s.fBitmap->height() - 1;
int ix = s.fFilterOneX + x;
@ -256,7 +256,7 @@ static void Clamp_S32_D32_nofilter_trans_shaderproc(const SkBitmapProcState& s,
SkIntToScalar(y) + SK_ScalarHalf, &pt);
int iy2 = SkClampMax(SkScalarFloorToInt(pt.fY), maxY);
int ix2 = SkScalarFloorToInt(pt.fX);
SkASSERT(iy == iy2);
SkASSERT(ix == ix2);
}

View File

@ -306,7 +306,7 @@ void SkARGB32_Shader_Blitter::blitH(int x, int y, int width) {
void SkARGB32_Shader_Blitter::blitRect(int x, int y, int width, int height) {
SkASSERT(x >= 0 && y >= 0 &&
x + width <= fDevice.width() && y + height <= fDevice.height());
uint32_t* device = fDevice.getAddr32(x, y);
size_t deviceRB = fDevice.rowBytes();
SkShader* shader = fShader;

View File

@ -133,16 +133,16 @@ public:
virtual void blitRect(int x, int y, int width, int height) SK_OVERRIDE;
virtual void blitAntiH(int x, int y, const SkAlpha antialias[], const int16_t runs[]);
virtual void blitMask(const SkMask&, const SkIRect&);
private:
SkXfermode* fXfermode;
SkPMColor* fBuffer;
SkBlitRow::Proc32 fProc32;
SkBlitRow::Proc32 fProc32Blend;
// illegal
SkARGB32_Shader_Blitter& operator=(const SkARGB32_Shader_Blitter&);
typedef SkShaderBlitter INHERITED;
};

View File

@ -87,7 +87,7 @@ bool SkColorFilterImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& sourc
SkColorFilter* parentColorFilter;
SkScalar parentMatrix[20];
while (parent && (parentColorFilter = parent->asColorFilter())
&& parentColorFilter->asColorMatrix(parentMatrix)
&& parentColorFilter->asColorMatrix(parentMatrix)
&& !matrix_needs_clamping(parentMatrix)) {
SkScalar combinedMatrix[20];
mult_color_matrix(parentMatrix, colorMatrix, combinedMatrix);

View File

@ -903,7 +903,7 @@ bool drawWithGPUMaskFilter(GrContext* context, const SkPath& devPath,
if (!am.setIdentity(context, grp)) {
return false;
}
static const int MASK_IDX = GrPaint::kMaxCoverageStages - 1;
// we assume the last mask index is available for use
GrAssert(!grp->isCoverageStageEnabled(MASK_IDX));

View File

@ -20,10 +20,10 @@ static bool S32A_D565_Blend_0(SkPMColor sc, uint16_t dc, U8CPU alpha) {
unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alpha);
unsigned dr = SkMulS16(SkPacked32ToR16(sc), alpha) + SkMulS16(SkGetPackedR16(dc), dst_scale);
unsigned dg = SkMulS16(SkPacked32ToG16(sc), alpha) + SkMulS16(SkGetPackedG16(dc), dst_scale);
unsigned rr = SkDiv255Round(dr);
unsigned rg = SkDiv255Round(dg);
if (rr <= 31 && rg <= 63) {
return true;
}
@ -34,10 +34,10 @@ static bool S32A_D565_Blend_01(SkPMColor sc, uint16_t dc, U8CPU alpha) {
unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alpha);
unsigned dr = SkMulS16(SkGetPackedR32(sc), alpha) + SkMulS16(SkGetPackedR16(dc) << 3, dst_scale);
unsigned dg = SkMulS16(SkGetPackedG32(sc), alpha) + SkMulS16(SkGetPackedG16(dc) << 2, dst_scale);
unsigned rr = SkDiv255Round(dr) >> 3;
unsigned rg = SkDiv255Round(dg) >> 2;
if (rr <= 31 && rg <= 63) {
return true;
}
@ -52,10 +52,10 @@ static bool S32A_D565_Blend_02(SkPMColor sc, uint16_t dc, U8CPU alpha) {
int rc = SkPack888ToRGB16(SkDiv255Round(dr),
SkDiv255Round(dg),
SkDiv255Round(db));
unsigned rr = SkGetPackedR16(rc);
unsigned rg = SkGetPackedG16(rc);
if (rr <= 31 && rg <= 63) {
return true;
}
@ -66,10 +66,10 @@ static bool S32A_D565_Blend_1(SkPMColor sc, uint16_t dc, U8CPU alpha) {
unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alpha);
unsigned dr = (SkMulS16(SkGetPackedR32(sc), alpha) >> 3) + SkMulS16(SkGetPackedR16(dc), dst_scale);
unsigned dg = (SkMulS16(SkGetPackedG32(sc), alpha) >> 2) + SkMulS16(SkGetPackedG16(dc), dst_scale);
unsigned rr = SkDiv255Round(dr);
unsigned rg = SkDiv255Round(dg);
if (rr <= 31 && rg <= 63) {
return true;
}
@ -85,10 +85,10 @@ static bool S32A_D565_Blend_2(SkPMColor sc, uint16_t dc, U8CPU alpha) {
alpha *= 255;
unsigned dr = (SkGetPackedR32(sc) >> 3) * alpha + SkGetPackedR16(dc) * dst_scale;
unsigned dg = (SkGetPackedG32(sc) >> 2) * alpha + SkGetPackedG16(dc) * dst_scale;
unsigned rr = SkDiv65025Round(dr);
unsigned rg = SkDiv65025Round(dg);
if (rr <= 31 && rg <= 63) {
return true;
}

View File

@ -84,18 +84,18 @@ static bool is_identity(const SkMatrix& m) {
static void test_matrix_recttorect(skiatest::Reporter* reporter) {
SkRect src, dst;
SkMatrix matrix;
src.set(0, 0, SK_Scalar1*10, SK_Scalar1*10);
dst = src;
matrix.setRectToRect(src, dst, SkMatrix::kFill_ScaleToFit);
REPORTER_ASSERT(reporter, SkMatrix::kIdentity_Mask == matrix.getType());
REPORTER_ASSERT(reporter, matrix.rectStaysRect());
dst.offset(SK_Scalar1, SK_Scalar1);
matrix.setRectToRect(src, dst, SkMatrix::kFill_ScaleToFit);
REPORTER_ASSERT(reporter, SkMatrix::kTranslate_Mask == matrix.getType());
REPORTER_ASSERT(reporter, matrix.rectStaysRect());
dst.fRight += SK_Scalar1;
matrix.setRectToRect(src, dst, SkMatrix::kFill_ScaleToFit);
REPORTER_ASSERT(reporter, SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask == matrix.getType());