diff --git a/bench/PathUtilsBench.cpp b/bench/PathUtilsBench.cpp index a53a1f59d2..bf7677b277 100644 --- a/bench/PathUtilsBench.cpp +++ b/bench/PathUtilsBench.cpp @@ -16,14 +16,14 @@ #define STRIDE 2 //this function is redefined for sample, test, and bench. is there anywhere -// I can put it to avoid code duplcation? +// I can put it to avoid code duplcation? static void fillRandomBits( int chars, char* bits ){ SkMWCRandom rand(SkTime::GetMSecs()); for (int i = 0; i < chars; ++i){ bits[i] = rand.nextU(); } -} +} static void path_proc(char* bits, SkPath* path) { SkPathUtils::BitsToPath_Path(path, bits, H, W, STRIDE); @@ -41,14 +41,14 @@ class PathUtilsBench : public SkBenchmark { int fH, fW, fStride; SkString fName; char* bits[H * STRIDE]; - + enum { N = SkBENCHLOOP(20) }; public: PathUtilsBench(void* param, Proc proc, const char name[]) : INHERITED(param) { fProc = proc; fName.printf("pathUtils_%s", name); - + } @@ -60,7 +60,7 @@ protected: for (int i = 0; i < N; ++i){ //create a random 16x16 bitmap fillRandomBits(H * STRIDE, (char*) &bits); - + //use passed function pointer to handle it SkPath path; fProc( (char*) &bits, &path); @@ -71,8 +71,8 @@ private: typedef SkBenchmark INHERITED; }; -static SkBenchmark* PU_path(void* p) { return SkNEW_ARGS(PathUtilsBench, (p, path_proc, "path")); } -static SkBenchmark* PU_region(void* p) { return SkNEW_ARGS(PathUtilsBench, (p, region_proc, "region")); } +static SkBenchmark* PU_path(void* p) { return SkNEW_ARGS(PathUtilsBench, (p, path_proc, "path")); } +static SkBenchmark* PU_region(void* p) { return SkNEW_ARGS(PathUtilsBench, (p, region_proc, "region")); } static BenchRegistry PU_Path(PU_path); static BenchRegistry PU_Region(PU_region); diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp index 502447a03d..0f4299fb36 100644 --- a/debugger/QT/SkDebuggerGUI.cpp +++ b/debugger/QT/SkDebuggerGUI.cpp @@ -713,7 +713,7 @@ void SkDebuggerGUI::setupUi(QMainWindow *SkDebuggerGUI) { fActionSettings.setShortcut(QKeySequence(tr("Ctrl+G"))); fActionSettings.setIcon(settings); fActionSettings.setText("Settings"); - + QIcon play; play.addFile(QString::fromUtf8(":/play.png"), QSize(), QIcon::Normal, QIcon::Off); diff --git a/samplecode/SamplePathUtils.cpp b/samplecode/SamplePathUtils.cpp index cc560589fa..c5ed0e9724 100644 --- a/samplecode/SamplePathUtils.cpp +++ b/samplecode/SamplePathUtils.cpp @@ -11,13 +11,13 @@ #include "SkView.h" //#include "SkPathOps.h" // loads fine here, won't in PathUtils src files #include "SkRandom.h" -//#include "SkTime.h" +//#include "SkTime.h" class samplePathUtils : public SampleView { public: samplePathUtils() { bmp_paint.setAntiAlias(true); // Black paint for bitmap - bmp_paint.setStyle(SkPaint::kFill_Style); + bmp_paint.setStyle(SkPaint::kFill_Style); bmp_paint.setColor(SK_ColorBLACK); } @@ -27,7 +27,7 @@ protected: static const int numChars = h * stride; // number of chars in entire array SkPaint bmp_paint; - + // overrides from SkEventSink virtual bool onQuery(SkEvent* evt) { if (SampleCode::TitleQ(*evt)) { @@ -38,13 +38,13 @@ protected: } ///////////////////////////////////////////////////////////// - + virtual void onDrawContent(SkCanvas* canvas) { // bitmap definitions const uint8_t bits[numModes][numChars] = { { 0x18, 0x00, 0x3c, 0x00, 0x7e, 0x00, 0xdb, 0x00, 0xff, 0x00, 0x24, 0x00, 0x5a, 0x00, 0xa5, 0x00 }, - + { 0x20, 0x80, 0x91, 0x20, 0xbf, 0xa0, 0xee, 0xe0, 0xff, 0xe0, 0x7f, 0xc0, 0x20, 0x80, 0x40, 0x40 }, @@ -57,17 +57,17 @@ protected: for (int i = 0; i < numModes; ++i) { SkPath path; // generate and simplify each path SkPathUtils::BitsToPath_Path(&path, (char*) &bits[i], h, w, stride); - + canvas->save(); // DRAWING canvas->scale(kScale, kScale); // scales up each bitmap canvas->translate(0, 1.5f * h * i); canvas->drawPath(path, bmp_paint); // draw bitmap canvas->restore(); - + // use the SkRegion method SkPath pathR; SkPathUtils::BitsToPath_Region(&pathR, (char*) &bits[i], h, w, stride); - + canvas->save(); canvas->scale(kScale, kScale); // scales up each bitmap @@ -76,7 +76,7 @@ protected: canvas->restore(); } } - + private: typedef SkView INHERITED; }; diff --git a/src/gpu/GrAARectRenderer.cpp b/src/gpu/GrAARectRenderer.cpp index d6a0f33ef4..5b10e95fb2 100644 --- a/src/gpu/GrAARectRenderer.cpp +++ b/src/gpu/GrAARectRenderer.cpp @@ -473,10 +473,10 @@ void GrAARectRenderer::geometryFillAARect(GrGpu* gpu, innerColor = GrColorPackRGBA(scale, scale, scale, scale); } else { if (0xff == scale) { - innerColor = target->getDrawState().getColor(); - } else { - innerColor = SkAlphaMulQ(target->getDrawState().getColor(), scale); - } + innerColor = target->getDrawState().getColor(); + } else { + innerColor = SkAlphaMulQ(target->getDrawState().getColor(), scale); + } } verts += 4 * vsize; @@ -768,8 +768,8 @@ void GrAARectRenderer::geometryStrokeAARect(GrGpu* gpu, innerColor = GrColorPackRGBA(scale, scale, scale, scale); } else { if (0xff == scale) { - innerColor = target->getDrawState().getColor(); - } else { + innerColor = target->getDrawState().getColor(); + } else { innerColor = SkAlphaMulQ(target->getDrawState().getColor(), scale); } } diff --git a/src/utils/SkPathUtils.cpp b/src/utils/SkPathUtils.cpp index 3ece6fc028..dd50ff7957 100644 --- a/src/utils/SkPathUtils.cpp +++ b/src/utils/SkPathUtils.cpp @@ -27,7 +27,7 @@ static void FillRandomBits( int chars, char* bits ){ bits[i] = rand.nextU(); } }OA -*/ +*/ static int GetBit( const char* buffer, int x ) { int byte = x >> 3; @@ -117,11 +117,11 @@ void SkPathUtils::BitsToPath_Region(SkPath* path, bool inRun = 0; int start = 1; const char* line = &bitmap[y * stride]; - - // loop for each pixel + + // loop for each pixel for (int i = 0; i < w; ++i) { int curPixel = GetBit(line,i); - + if ( (curPixel!=0) != inRun ) { // if transition if (curPixel) { // if transition on inRun = 1; @@ -140,7 +140,7 @@ void SkPathUtils::BitsToPath_Region(SkPath* path, // add the thing here region.op(SkIRect::MakeXYWH(start, y, w-1-start+end, 1), SkRegion::kUnion_Op ); - + } else if ( GetBit(line,w-1) ) { // if last pixel on add rect // add the thing here region.op(SkIRect::MakeXYWH(w-1, y, 1, 1), diff --git a/tests/PathUtilsTest.cpp b/tests/PathUtilsTest.cpp index 973a6afffe..1b497880b2 100644 --- a/tests/PathUtilsTest.cpp +++ b/tests/PathUtilsTest.cpp @@ -16,12 +16,12 @@ #define NUM_IT 1000 #define ON 0xFF000000 // black pixel -#define OFF 0x00000000 // transparent pixel +#define OFF 0x00000000 // transparent pixel class SkBitmap; //this function is redefined for sample, test, and bench. is there anywhere -// I can put it to avoid code duplcation? +// I can put it to avoid code duplcation? static void fillRandomBits( int chars, char* bits ){ SkMWCRandom rand(SkTime::GetMSecs()); @@ -77,7 +77,7 @@ static void test_path_eq(skiatest::Reporter* reporter, const SkPath* path, bmpPaint.setAntiAlias(true); // Black paint for bitmap bmpPaint.setStyle(SkPaint::kFill_Style); bmpPaint.setColor(SK_ColorBLACK); - + // make bmp SkBitmap bmp; bmp.setConfig(SkBitmap::kARGB_8888_Config, w, h); @@ -93,7 +93,7 @@ static void test_path(skiatest::Reporter* reporter, const SkBitmap* truth, // make path SkPath path; SkPathUtils::BitsToPath_Path(&path, bin_bmp, h, w, stride); - + //test for correctness test_path_eq(reporter, &path, truth, h, w); } @@ -103,7 +103,7 @@ static void test_region(skiatest::Reporter* reporter, const SkBitmap* truth, //generate bitmap SkPath path; SkPathUtils::BitsToPath_Region(&path, bin_bmp, h, w, stride); - + //test for correctness test_path_eq(reporter, &path, truth, h, w); } @@ -121,8 +121,8 @@ static void TestPathUtils(skiatest::Reporter* reporter) { for (int it = 0; it < NUM_IT; ++it) { // generate a random binary bitmap - fillRandomBits( h * stride, bin_bmp); // generate random bitmap - + fillRandomBits( h * stride, bin_bmp); // generate random bitmap + // for each bitmap width, use subset of binary bitmap for (int i = 0; i < W_tests; ++i) { // generate truth bitmap