From 63fd760a37905c45d26fc3d49cac261fad1b4808 Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Mon, 9 Oct 2017 15:45:33 -0400 Subject: Remove trailing whitespace. Also adds a presubmit to prevent adding trailing whitespace to source code in the future. Change-Id: I41a4df81487f6f00aa19b188f0cac6a3377efde6 Reviewed-on: https://skia-review.googlesource.com/57380 Reviewed-by: Ravi Mistry Reviewed-by: Mike Reed Commit-Queue: Ben Wagner --- PRESUBMIT.py | 3 + bench/BlurImageFilterBench.cpp | 2 +- bench/GLBench.cpp | 2 +- bench/HardStopGradientBench_ScaleNumColors.cpp | 2 +- bench/HardStopGradientBench_ScaleNumHardStops.cpp | 4 +- bench/HardStopGradientBench_SpecialHardStops.cpp | 4 +- bench/MathBench.cpp | 2 +- debugger/SkDebugger.cpp | 2 +- debugger/SkDebugger.h | 2 +- example/mac/HelloWorldNSView.mm | 2 +- experimental/FileReaderApp/FileReaderWindow.mm | 18 +++-- experimental/GLFWTest/glfw_main.cpp | 42 +++++----- experimental/SimpleiOSApp/iPad/AppDelegate_iPad.m | 8 +- .../SimpleiOSApp/iPhone/AppDelegate_iPhone.m | 10 +-- .../iOSSampleApp/Shared/SkOptionListController.mm | 15 +++- .../Shared/SkOptionsTableViewController.mm | 94 ++++++++++++---------- .../Shared/SkUIDetailViewController.mm | 48 ++++++----- experimental/iOSSampleApp/Shared/skia_ios.mm | 4 +- experimental/iOSSampleApp/SkSampleUIView.mm | 88 ++++++++++---------- experimental/tools/mskp_parser.py | 2 +- gm/cgm.c | 12 +-- gm/dashing.cpp | 2 +- gm/hardstop_gradients.cpp | 4 +- gm/reveal.cpp | 12 +-- gm/skbug_5321.cpp | 4 +- include/core/SkCanvas.h | 4 +- include/core/SkColorPriv.h | 2 +- include/core/SkDrawable.h | 2 +- include/core/SkImageFilter.h | 4 +- include/core/SkImageInfo.h | 6 +- include/core/SkMatrix.h | 10 +-- include/core/SkPoint.h | 8 +- include/core/SkPoint3.h | 2 +- include/core/SkRSXform.h | 2 +- include/core/SkRWBuffer.h | 4 +- include/effects/SkLayerRasterizer.h | 2 +- include/effects/SkRRectsGaussianEdgeMaskFilter.h | 2 +- include/gpu/GrColor.h | 2 +- include/gpu/vk/GrVkBackendContext.h | 4 +- include/pathops/SkPathOps.h | 4 +- include/private/GrAuditTrail.h | 4 +- include/utils/SkDumpCanvas.h | 2 +- include/utils/SkTextBox.h | 2 +- include/views/SkEventSink.h | 2 +- infra/bots/zip_utils_test.py | 2 +- samplecode/PerlinPatch.cpp | 2 +- samplecode/SampleAAGeometry.cpp | 34 ++++---- samplecode/SampleBigGradient.cpp | 8 +- samplecode/SampleCowboy.cpp | 12 +-- samplecode/SamplePath.cpp | 26 +++--- samplecode/SamplePictFile.cpp | 2 +- src/codec/SkRawCodec.cpp | 2 +- src/core/SkBitmapCache.cpp | 2 +- src/core/SkBuffer.cpp | 2 +- src/core/SkCanvas.cpp | 4 +- src/core/SkColorSpace_ICC.cpp | 8 +- src/core/SkGeometry.cpp | 4 +- src/core/SkMatrixPriv.h | 6 +- src/core/SkPaintPriv.h | 2 +- src/core/SkPathEffect.cpp | 4 +- src/core/SkPictureData.cpp | 2 +- src/core/SkReadBuffer.h | 2 +- src/core/SkRegion.cpp | 2 +- src/core/SkStroke.cpp | 2 +- src/core/SkTextBlob.cpp | 4 +- src/core/SkVertices.cpp | 2 +- src/effects/SkDropShadowImageFilter.cpp | 2 +- src/effects/SkEmbossMaskFilter.h | 2 +- src/effects/SkPictureImageFilter.cpp | 4 +- src/effects/SkRRectsGaussianEdgeMaskFilter.cpp | 10 +-- src/effects/SkTileImageFilter.cpp | 2 +- src/effects/SkXfermodeImageFilter.cpp | 4 +- src/gpu/GrShaderVar.h | 2 +- src/gpu/GrSurfaceContextPriv.h | 2 +- src/gpu/GrSurfaceProxy.cpp | 2 +- src/gpu/GrTessellator.h | 2 +- src/gpu/gl/GrGLCaps.cpp | 2 +- src/gpu/gl/GrGLContext.h | 2 +- src/gpu/gl/GrGLGpu.cpp | 2 +- src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp | 2 +- src/gpu/instanced/InstancedRendering.h | 2 +- src/gpu/mtl/GrMtlCaps.h | 2 +- src/gpu/ops/GrAAConvexTessellator.cpp | 2 +- src/gpu/ops/GrAAConvexTessellator.h | 2 +- src/gpu/ops/GrAtlasTextOp.h | 2 +- src/gpu/vk/GrVkDescriptorPool.h | 2 +- src/gpu/vk/GrVkMemory.cpp | 2 +- src/gpu/vk/GrVkMemory.h | 2 +- src/pathops/SkAddIntersections.cpp | 2 +- src/pathops/SkDLineIntersection.cpp | 4 +- src/pathops/SkOpCubicHull.cpp | 2 +- src/pathops/SkOpSpan.cpp | 2 +- src/pathops/SkPathOpsCommon.cpp | 2 +- src/pathops/SkPathOpsDebug.cpp | 14 ++-- src/pathops/SkPathOpsDebug.h | 2 +- src/pathops/SkPathOpsTSect.cpp | 24 +++--- src/pathops/SkPathWriter.cpp | 2 +- src/pathops/SkPathWriter.h | 2 +- src/pipe/SkPipeCanvas.h | 2 +- src/pipe/SkPipeFormat.h | 8 +- src/pipe/SkPipeReader.cpp | 18 ++--- src/shaders/SkPerlinNoiseShader.cpp | 2 +- src/shaders/gradients/SkRadialGradient.h | 2 +- .../gradients/SkTwoPointConicalGradient_gpu.cpp | 2 +- src/sksl/GLSL.std.450.h | 2 +- src/sksl/spirv.h | 14 ++-- src/views/mac/SkTextFieldCell.m | 44 +++++----- src/xml/SkXMLWriter.cpp | 4 +- tests/BlurTest.cpp | 8 +- tests/DiscardableMemoryTest.cpp | 2 +- tests/MatrixTest.cpp | 4 +- tests/PathOpsCubicIntersectionTest.cpp | 2 +- tests/PathOpsSimplifyTest.cpp | 26 +++--- tests/PathOpsTigerTest.cpp | 2 +- tests/RenderTargetContextTest.cpp | 2 +- tools/add_codereview_message.py | 6 +- tools/bookmaker/bookmaker.cpp | 44 +++++----- tools/bookmaker/bookmaker.h | 66 +++++++-------- tools/bookmaker/includeParser.cpp | 28 +++---- tools/bookmaker/includeWriter.cpp | 30 +++---- tools/bookmaker/mdOut.cpp | 16 ++-- tools/bookmaker/spellCheck.cpp | 12 +-- tools/get_current_monitor_profile.cpp | 4 +- tools/merge_static_libs.py | 10 +-- tools/mirror-dev.sh | 14 ++-- tools/skiaserve/tester/tester.py | 4 +- tools/test_gpuveto.py | 25 +++--- tools/viewer/sk_app/Window.cpp | 4 +- tools/viewer/sk_app/ios/Window_ios.cpp | 2 +- tools/viewer/sk_app/mac/GLWindowContext_mac.cpp | 8 +- .../viewer/sk_app/mac/RasterWindowContext_mac.cpp | 2 +- tools/viewer/sk_app/mac/Window_mac.cpp | 4 +- tools/viewer/sk_app/mac/Window_mac.h | 4 +- tools/viewer/sk_app/mac/main_mac.cpp | 4 +- tools/viewer/sk_app/unix/Window_unix.cpp | 12 +-- tools/viewer/sk_app/unix/Window_unix.h | 12 +-- tools/viewer/sk_app/unix/main_unix.cpp | 4 +- tools/viewer/sk_app/win/Window_win.cpp | 10 +-- 138 files changed, 605 insertions(+), 566 deletions(-) diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 0fe4841c79..0f37de4aba 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -225,6 +225,9 @@ def _CommonChecks(input_api, output_api): results.extend( input_api.canned_checks.CheckChangeHasNoCR( input_api, output_api, source_file_filter=sources)) + results.extend( + input_api.canned_checks.CheckChangeHasNoStrayWhitespace( + input_api, output_api, source_file_filter=sources)) results.extend(_PythonChecks(input_api, output_api)) results.extend(_IfDefChecks(input_api, output_api)) results.extend(_CopyrightChecks(input_api, output_api, diff --git a/bench/BlurImageFilterBench.cpp b/bench/BlurImageFilterBench.cpp index 9560263f1d..5438daf789 100644 --- a/bench/BlurImageFilterBench.cpp +++ b/bench/BlurImageFilterBench.cpp @@ -98,7 +98,7 @@ protected: const SkImageFilter::CropRect cropRect(bmpRect.makeInset(10.f, 10.f)); const SkImageFilter::CropRect cropRectLarge(bmpRect); - sk_sp input = fIsExpanded + sk_sp input = fIsExpanded ? SkOffsetImageFilter::Make(0, 0, nullptr, &cropRect) : nullptr; diff --git a/bench/GLBench.cpp b/bench/GLBench.cpp index 316cca6456..10a63670fc 100644 --- a/bench/GLBench.cpp +++ b/bench/GLBench.cpp @@ -102,7 +102,7 @@ GrGLuint GLBench::CompileShader(const GrGLContext* context, const char* sksl, Gr return shader; } -GrGLuint GLBench::CreateProgram(const GrGLContext* context, const char* vshader, +GrGLuint GLBench::CreateProgram(const GrGLContext* context, const char* vshader, const char* fshader) { const GrGLInterface* gl = context->interface(); GrGLuint vertexShader = CompileShader(context, vshader, GR_GL_VERTEX_SHADER); diff --git a/bench/HardStopGradientBench_ScaleNumColors.cpp b/bench/HardStopGradientBench_ScaleNumColors.cpp index 108803c496..cedbd72d6b 100644 --- a/bench/HardStopGradientBench_ScaleNumColors.cpp +++ b/bench/HardStopGradientBench_ScaleNumColors.cpp @@ -55,7 +55,7 @@ public: void onPreDraw(SkCanvas* canvas) override { // Left to right SkPoint points[2] = { - SkPoint::Make(0, kSize/2), + SkPoint::Make(0, kSize/2), SkPoint::Make(kSize-1, kSize/2), }; diff --git a/bench/HardStopGradientBench_ScaleNumHardStops.cpp b/bench/HardStopGradientBench_ScaleNumHardStops.cpp index 2b8b55e67a..843bb725f2 100644 --- a/bench/HardStopGradientBench_ScaleNumHardStops.cpp +++ b/bench/HardStopGradientBench_ScaleNumHardStops.cpp @@ -19,7 +19,7 @@ public: HardStopGradientBench_ScaleNumHardStops(int colorCount, int hardStopCount) { SkASSERT(hardStopCount <= colorCount/2); - fName.printf("hardstop_scale_num_hard_stops_%03d_colors_%03d_hard_stops", + fName.printf("hardstop_scale_num_hard_stops_%03d_colors_%03d_hard_stops", colorCount, hardStopCount); fColorCount = colorCount; @@ -37,7 +37,7 @@ public: void onPreDraw(SkCanvas* canvas) override { // Left to right SkPoint points[2] = { - SkPoint::Make(0, kSize/2), + SkPoint::Make(0, kSize/2), SkPoint::Make(kSize-1, kSize/2), }; diff --git a/bench/HardStopGradientBench_SpecialHardStops.cpp b/bench/HardStopGradientBench_SpecialHardStops.cpp index 0a9e23e81b..e987901c67 100644 --- a/bench/HardStopGradientBench_SpecialHardStops.cpp +++ b/bench/HardStopGradientBench_SpecialHardStops.cpp @@ -84,7 +84,7 @@ public: }; SkScalar* positions = fKind == Kind::k001 ? pos_001 : - fKind == Kind::k011 ? pos_011 : + fKind == Kind::k011 ? pos_011 : pos_centered; int count = fKind == Kind::kCentered ? 4 : 3; @@ -109,7 +109,7 @@ private: int fW; int fH; Kind fKind; - SkPaint fPaint; + SkPaint fPaint; }; DEF_BENCH(return new HardStopGradientBench_SpecialHardStops(100, 100, Kind::k001);); diff --git a/bench/MathBench.cpp b/bench/MathBench.cpp index 72161549d2..7f3408e8e4 100644 --- a/bench/MathBench.cpp +++ b/bench/MathBench.cpp @@ -657,7 +657,7 @@ protected: private: const char* fName; - + typedef Benchmark INHERITED; }; DEF_BENCH( return new Floor2IntBench(false); ) diff --git a/debugger/SkDebugger.cpp b/debugger/SkDebugger.cpp index 197a27ff8a..77161126fa 100644 --- a/debugger/SkDebugger.cpp +++ b/debugger/SkDebugger.cpp @@ -33,7 +33,7 @@ sk_sp SkDebugger::copyPicture() { // We can't just call clone here since we want to removed the "deleted" // commands. Playing back will strip those out. SkPictureRecorder recorder; - SkCanvas* canvas = recorder.beginRecording(this->pictureCull().width(), + SkCanvas* canvas = recorder.beginRecording(this->pictureCull().width(), this->pictureCull().height()); bool vizMode = fDebugCanvas->getMegaVizMode(); diff --git a/debugger/SkDebugger.h b/debugger/SkDebugger.h index 7e58047942..50ab18168d 100644 --- a/debugger/SkDebugger.h +++ b/debugger/SkDebugger.h @@ -85,7 +85,7 @@ public: return fDebugCanvas->getCurrentClip(); } - SkRect pictureCull() const { + SkRect pictureCull() const { return fPicture ? fPicture->cullRect() : SkRect::MakeEmpty(); } diff --git a/example/mac/HelloWorldNSView.mm b/example/mac/HelloWorldNSView.mm index dcc82e34dc..63852e5250 100644 --- a/example/mac/HelloWorldNSView.mm +++ b/example/mac/HelloWorldNSView.mm @@ -8,7 +8,7 @@ #import "HelloWorldNSView.h" #include "SkApplication.h" -#include +#include @implementation HelloWorldNSView diff --git a/experimental/FileReaderApp/FileReaderWindow.mm b/experimental/FileReaderApp/FileReaderWindow.mm index 87b9ab18db..ed4585e140 100644 --- a/experimental/FileReaderApp/FileReaderWindow.mm +++ b/experimental/FileReaderApp/FileReaderWindow.mm @@ -1,3 +1,10 @@ +/* + * Copyright 2011 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + #import "FileReaderWindow.h" #import "SkGradientShader.h" @@ -9,7 +16,7 @@ static void init_effects() { SkPoint pts[] = {p, q}; SkColor colors[] = { SK_ColorRED, SK_ColorGREEN }; SkScalar pos[] = { 0, 1.0}; - SkGradientShader::CreateLinear(pts, colors, pos, 2, + SkGradientShader::CreateLinear(pts, colors, pos, 2, SkShader::kMirror_TileMode); } } @@ -23,13 +30,14 @@ static void init_effects() { [fView addSkView:fReaderView]; [fView setNeedsDisplay:YES]; fReaderView->unref(); - //TODO - Temporary fix. Inval doesn't Seem to be working. - [NSTimer scheduledTimerWithTimeInterval:0.01 target:self - selector:@selector(redraw) userInfo:nil + //TODO - Temporary fix. Inval doesn't Seem to be working. + [NSTimer scheduledTimerWithTimeInterval:0.01 target:self + selector:@selector(redraw) userInfo:nil repeats:YES]; } - (void)redraw { [fView setNeedsDisplay:YES]; } -@end \ No newline at end of file +@end + diff --git a/experimental/GLFWTest/glfw_main.cpp b/experimental/GLFWTest/glfw_main.cpp index f0e3297e8a..26ed75b9c8 100644 --- a/experimental/GLFWTest/glfw_main.cpp +++ b/experimental/GLFWTest/glfw_main.cpp @@ -60,22 +60,22 @@ int main(void) { if (!glfwInit()) { exit(EXIT_FAILURE); } - + glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); glfwWindowHint(GLFW_SRGB_CAPABLE, GL_TRUE); - + window = glfwCreateWindow(kWidth, kHeight, "Simple example", NULL, NULL); if (!window) { glfwTerminate(); exit(EXIT_FAILURE); } glfwMakeContextCurrent(window); - + init_skia(kWidth, kHeight); - + sk_sp atlas; SkRSXform xform[kGrid*kGrid+1]; SkRect tex[kGrid*kGrid+1]; @@ -87,13 +87,13 @@ int main(void) { atlas.reset(SkImage::NewFromEncoded(imageData.get())); if (!atlas) { SkDebugf("\nCould not decode file ship.png\n"); - + cleanup_skia(); glfwDestroyWindow(window); glfwTerminate(); exit(EXIT_FAILURE); } - + SkScalar anchorX = atlas->width()*0.5f; SkScalar anchorY = atlas->height()*0.5f; int currIndex = 0; @@ -101,7 +101,7 @@ int main(void) { for (int y = 0; y < kGrid; y++) { float xPos = (x / (kGrid - 1.0)) * kWidth; float yPos = (y / (kGrid - 1.0)) * kWidth; - + tex[currIndex] = SkRect::MakeLTRB(0.0f, 0.0f, atlas->width(), atlas->height()); xform[currIndex] = SkRSXform::MakeFromRadians(2.0f, SK_ScalarPI*0.5f, xPos, yPos, anchorX, anchorY); @@ -111,12 +111,12 @@ int main(void) { tex[currIndex] = SkRect::MakeLTRB(0.0f, 0.0f, atlas->width(), atlas->height()); xform[currIndex] = SkRSXform::MakeFromRadians(2.0f, SK_ScalarPI*0.5f, kWidth*0.5f, kHeight*0.5f, anchorX, anchorY); - + currentTime = 0; - + glfwSwapInterval(1); glfwSetKeyCallback(window, key_callback); - + // Draw to the surface via its SkCanvas. SkCanvas* canvas = sSurface->getCanvas(); // We don't manage this pointer's lifetime. SkPaint paint; @@ -129,9 +129,9 @@ int main(void) { const float kSinDiff = 0.01745240643f; timer.start(); - + glfwPollEvents(); - + float meanTime = 0.0f; for (int i = 0; i < 32; ++i) { meanTime += times[i]; @@ -140,39 +140,39 @@ int main(void) { char outString[64]; float fps = 1000.f/meanTime; sprintf(outString, "fps: %f ms: %f", fps, meanTime); - + for (int i = 0; i < kGrid*kGrid+1; ++i) { SkScalar c = xform[i].fSCos; SkScalar s = xform[i].fSSin; - + SkScalar dx = c*anchorX - s*anchorY; SkScalar dy = s*anchorX + c*anchorY; xform[i].fSCos = kCosDiff*c - kSinDiff*s; xform[i].fSSin = kSinDiff*c + kCosDiff*s; - + dx -= xform[i].fSCos*anchorX - xform[i].fSSin*anchorY; dy -= xform[i].fSSin*anchorX + xform[i].fSCos*anchorY; xform[i].fTx += dx; xform[i].fTy += dy; } - + canvas->clear(SK_ColorBLACK); canvas->drawAtlas(atlas, xform, tex, nullptr, kGrid*kGrid+1, SkXfermode::kSrcOver_Mode, nullptr, &paint); canvas->drawText(outString, strlen(outString), 100.f, 100.f, paint); - + canvas->flush(); - + timer.end(); times[currentTime] = (float)(timer.fWall); currentTime = (currentTime + 1) & 0x1f; - + glfwSwapBuffers(window); } - + cleanup_skia(); - + glfwDestroyWindow(window); glfwTerminate(); exit(EXIT_SUCCESS); diff --git a/experimental/SimpleiOSApp/iPad/AppDelegate_iPad.m b/experimental/SimpleiOSApp/iPad/AppDelegate_iPad.m index 1792658b92..60619c567f 100644 --- a/experimental/SimpleiOSApp/iPad/AppDelegate_iPad.m +++ b/experimental/SimpleiOSApp/iPad/AppDelegate_iPad.m @@ -16,12 +16,12 @@ #pragma mark - #pragma mark Application lifecycle -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. - + [self.window makeKeyAndVisible]; - + return YES; } diff --git a/experimental/SimpleiOSApp/iPhone/AppDelegate_iPhone.m b/experimental/SimpleiOSApp/iPhone/AppDelegate_iPhone.m index dcf14f21a8..11334281ca 100644 --- a/experimental/SimpleiOSApp/iPhone/AppDelegate_iPhone.m +++ b/experimental/SimpleiOSApp/iPhone/AppDelegate_iPhone.m @@ -16,12 +16,12 @@ #pragma mark - #pragma mark Application lifecycle -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. - + [self.window makeKeyAndVisible]; - + return YES; } @@ -36,7 +36,7 @@ - (void)applicationDidEnterBackground:(UIApplication *)application { /* - Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. If your application supports background execution, called instead of applicationWillTerminate: when the user quits. */ } diff --git a/experimental/iOSSampleApp/Shared/SkOptionListController.mm b/experimental/iOSSampleApp/Shared/SkOptionListController.mm index d5241348b1..0f67a0bdb9 100644 --- a/experimental/iOSSampleApp/Shared/SkOptionListController.mm +++ b/experimental/iOSSampleApp/Shared/SkOptionListController.mm @@ -1,3 +1,10 @@ +/* + * Copyright 2011 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + #import "SkOptionListController.h" @implementation SkOptionListController @@ -37,14 +44,14 @@ } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - + static NSString *CellIdentifier = @"Cell"; - + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } - + cell.textLabel.text = [fOptions objectAtIndex:indexPath.row]; if (indexPath.row == fSelectedIndex) { cell.accessoryType = UITableViewCellAccessoryCheckmark; @@ -52,7 +59,7 @@ } else cell.accessoryType = UITableViewCellAccessoryNone; - + return cell; } diff --git a/experimental/iOSSampleApp/Shared/SkOptionsTableViewController.mm b/experimental/iOSSampleApp/Shared/SkOptionsTableViewController.mm index e6adfd0bd1..a862030f2d 100644 --- a/experimental/iOSSampleApp/Shared/SkOptionsTableViewController.mm +++ b/experimental/iOSSampleApp/Shared/SkOptionsTableViewController.mm @@ -1,3 +1,10 @@ +/* + * Copyright 2011 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + #import "SkOptionsTableViewController.h" #include "SkEvent.h" #include "SkTArray.h" @@ -52,8 +59,8 @@ } - (void)updateMenu:(SkOSMenu*)menu { - // the first menu is always assumed to be the static, the second is - // repopulated every time over and over again + // the first menu is always assumed to be the static, the second is + // repopulated every time over and over again int menuIndex = fMenus->find(menu); if (menuIndex >= 0 && menuIndex < fMenus->count()) { NSUInteger first = 0; @@ -72,14 +79,14 @@ for (int i = 0; i < menu->getCount(); ++i) { const SkOSMenu::Item* item = menuitems[i]; NSString* title = [NSString stringWithUTF8String:item->getLabel()]; - + if (SkOSMenu::kList_Type == item->getType()) { int value = 0; SkOptionListItem* List = [[SkOptionListItem alloc] init]; List.fItem = item; List.fOptions = [[SkOptionListController alloc] initWithStyle:UITableViewStyleGrouped]; - + int count = 0; SkOSMenu::FindListItemCount(*item->getEvent(), &count); SkTArray options; @@ -88,7 +95,7 @@ for (int i = 0; i < count; ++i) [List.fOptions addOption:[NSString stringWithUTF8String:options[i].c_str()]]; SkOSMenu::FindListIndex(*item->getEvent(), item->getSlotName(), &value); - + List.fOptions.fSelectedIndex = value; List.fCell = [self createList:title default:[List.fOptions getSelectedOption]]; @@ -99,7 +106,7 @@ else { SkOptionItem* option = [[SkOptionItem alloc] init]; option.fItem = item; - + bool state = false; SkString str; SkOSMenu::TriState tristate; @@ -116,18 +123,18 @@ SkOSMenu::FindSliderValue(*item->getEvent(), item->getSlotName(), &value); SkOSMenu::FindSliderMin(*item->getEvent(), &min); SkOSMenu::FindSliderMax(*item->getEvent(), &max); - option.fCell = [self createSlider:title - min:min + option.fCell = [self createSlider:title + min:min max:max default:value]; - break; + break; case SkOSMenu::kTriState_Type: SkOSMenu::FindTriState(*item->getEvent(), item->getSlotName(), &tristate); option.fCell = [self createTriState:title default:(int)tristate]; break; case SkOSMenu::kTextField_Type: SkOSMenu::FindText(*item->getEvent(), item->getSlotName(), &str); - option.fCell = [self createTextField:title + option.fCell = [self createTextField:title default:[NSString stringWithUTF8String:str.c_str()]]; break; default: @@ -175,34 +182,34 @@ - (UITableViewCell*)createAction:(NSString*)title { UITableViewCell* cell = [[[UITableViewCell alloc] - initWithStyle:UITableViewCellStyleValue1 + initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil] autorelease]; cell.textLabel.text = title; return cell; } - (UITableViewCell*)createSwitch:(NSString*)title default:(BOOL)state { - UITableViewCell* cell = [[[UITableViewCell alloc] - initWithStyle:UITableViewCellStyleValue1 + UITableViewCell* cell = [[[UITableViewCell alloc] + initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil] autorelease]; cell.textLabel.text = title; cell.selectionStyle = UITableViewCellSelectionStyleNone; UISwitch* switchView = [[UISwitch alloc] initWithFrame:CGRectZero]; [switchView setOn:state animated:NO]; - [switchView addTarget:self - action:@selector(valueChanged:) + [switchView addTarget:self + action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged]; cell.accessoryView = switchView; [switchView release]; return cell; } -- (UITableViewCell*)createSlider:(NSString*)title - min:(float)min - max:(float)max +- (UITableViewCell*)createSlider:(NSString*)title + min:(float)min + max:(float)max default:(float)value { - UITableViewCell* cell = [[[UITableViewCell alloc] - initWithStyle:UITableViewCellStyleValue1 + UITableViewCell* cell = [[[UITableViewCell alloc] + initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil] autorelease]; cell.textLabel.text = title; cell.selectionStyle = UITableViewCellSelectionStyleNone; @@ -210,18 +217,18 @@ sliderView.value = value; sliderView.minimumValue = min; sliderView.maximumValue = max; - [sliderView addTarget:self - action:@selector(valueChanged:) + [sliderView addTarget:self + action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged]; cell.detailTextLabel.text = [NSString stringWithFormat:@"%1.1f", value]; - cell.accessoryView = sliderView; + cell.accessoryView = sliderView; [sliderView release]; return cell; } - (UITableViewCell*)createTriState:(NSString*)title default:(int)index { - UITableViewCell* cell = [[[UITableViewCell alloc] - initWithStyle:UITableViewCellStyleValue1 + UITableViewCell* cell = [[[UITableViewCell alloc] + initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil] autorelease]; cell.textLabel.text = title; cell.selectionStyle = UITableViewCellSelectionStyleNone; @@ -229,44 +236,44 @@ UISegmentedControl* segmented = [[UISegmentedControl alloc] initWithItems:items]; segmented.selectedSegmentIndex = (index == -1) ? 2 : index; segmented.segmentedControlStyle = UISegmentedControlStyleBar; - [segmented addTarget:self - action:@selector(valueChanged:) + [segmented addTarget:self + action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged]; cell.accessoryView = segmented; [segmented release]; - return cell; + return cell; } -- (UITableViewCell*)createTextField:(NSString*)title +- (UITableViewCell*)createTextField:(NSString*)title default:(NSString*)value { - UITableViewCell* cell = [[[UITableViewCell alloc] - initWithStyle:UITableViewCellStyleValue1 + UITableViewCell* cell = [[[UITableViewCell alloc] + initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil] autorelease]; cell.textLabel.text = title; cell.selectionStyle = UITableViewCellSelectionStyleNone; - UITextField* textField = [[UITextField alloc] + UITextField* textField = [[UITextField alloc] initWithFrame:CGRectMake(0, 10, 150, 25)]; textField.adjustsFontSizeToFitWidth = YES; textField.textAlignment = NSTextAlignmentRight; textField.textColor = cell.detailTextLabel.textColor; textField.placeholder = value; textField.returnKeyType = UIReturnKeyDone; - [textField addTarget:self - action:@selector(valueChanged:) + [textField addTarget:self + action:@selector(valueChanged:) forControlEvents:UIControlEventEditingDidEndOnExit]; - cell.accessoryView = textField; + cell.accessoryView = textField; [textField release]; return cell; } - (UITableViewCell*)createList:(NSString*)title default:(NSString*)value{ - UITableViewCell* cell = [[[UITableViewCell alloc] - initWithStyle:UITableViewCellStyleValue1 + UITableViewCell* cell = [[[UITableViewCell alloc] + initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil] autorelease]; cell.textLabel.text = title; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; cell.detailTextLabel.text = value; - return cell; + return cell; } #pragma mark - @@ -294,7 +301,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell* cell = [tableView cellForRowAtIndexPath:indexPath]; id item = [fItems objectAtIndex:[self convertPathToIndex:indexPath]]; - + if ([item isKindOfClass:[SkOptionListItem class]]) { SkOptionListItem* list = (SkOptionListItem*)item; self.fCurrentList = list; @@ -306,7 +313,7 @@ SkOptionItem* action = (SkOptionItem*)item; action.fItem->postEvent(); } - } + } else{ NSLog(@"unknown"); } @@ -317,8 +324,8 @@ #pragma mark - #pragma mark Navigation controller delegate -- (void)navigationController:(UINavigationController *)navigationController - willShowViewController:(UIViewController *)viewController +- (void)navigationController:(UINavigationController *)navigationController + willShowViewController:(UIViewController *)viewController animated:(BOOL)animated { if (self == viewController) { //when a List option is popped, trigger event NSString* selectedOption = [fCurrentList.fOptions getSelectedOption]; @@ -336,4 +343,5 @@ [super dealloc]; } -@end \ No newline at end of file +@end + diff --git a/experimental/iOSSampleApp/Shared/SkUIDetailViewController.mm b/experimental/iOSSampleApp/Shared/SkUIDetailViewController.mm index 0ab71d9b1e..76ef7e13fd 100644 --- a/experimental/iOSSampleApp/Shared/SkUIDetailViewController.mm +++ b/experimental/iOSSampleApp/Shared/SkUIDetailViewController.mm @@ -1,3 +1,10 @@ +/* + * Copyright 2011 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + #import "SkUIDetailViewController.h" #include "SampleApp.h" #include "SkCGUtils.h" @@ -11,43 +18,43 @@ [super viewDidLoad]; fSkUIView = (SkUIView*)self.view; - + fWind = (SampleWindow*)fSkUIView.fWind; fSkUIView.fTitleItem = self.navigationItem; - + [self createButtons]; - + UISwipeGestureRecognizer* swipe = [[UISwipeGestureRecognizer alloc] - initWithTarget:self + initWithTarget:self action:@selector(handleSwipe:)]; [self.navigationController.navigationBar addGestureRecognizer:swipe]; [swipe release]; swipe = [[UISwipeGestureRecognizer alloc] - initWithTarget:self + initWithTarget:self action:@selector(handleSwipe:)]; swipe.direction = UISwipeGestureRecognizerDirectionLeft; [self.navigationController.navigationBar addGestureRecognizer:swipe]; [swipe release]; - - fOptionsController = [[SkOptionsTableViewController alloc] + + fOptionsController = [[SkOptionsTableViewController alloc] initWithStyle:UITableViewStyleGrouped]; fSkUIView.fOptionsDelegate = fOptionsController; [fOptionsController registerMenus:fWind->getMenus()]; - + } - (void)createButtons { UIToolbar* toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 125, 45)]; [toolbar setBarStyle: UIBarStyleBlackOpaque]; - + UIBarButtonItem* flexibleSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]; - + fOptionsButton = [[UIBarButtonItem alloc] - initWithTitle:@"Options" + initWithTitle:@"Options" style:UIBarButtonItemStylePlain target:self action:@selector(presentOptions)]; @@ -56,7 +63,7 @@ target:nil action:nil]; fixedSpace.width = 10; - + fPrintButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self @@ -65,7 +72,7 @@ [toolbar setItems:[NSArray arrayWithObjects:flexibleSpace, fOptionsButton, fixedSpace, fPrintButton, nil] animated:NO]; - + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:toolbar]; [flexibleSpace release]; @@ -140,20 +147,20 @@ - (void)presentOptions { if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { if (nil == fPopOverController) { - UINavigationController* navigation = [[UINavigationController alloc] + UINavigationController* navigation = [[UINavigationController alloc] initWithRootViewController:fOptionsController]; navigation.navigationBar.topItem.title = @"Options"; fPopOverController = [[UIPopoverController alloc] initWithContentViewController:navigation]; [navigation release]; } - + if (fPopOverController.isPopoverVisible) [fPopOverController dismissPopoverAnimated:YES]; else - [fPopOverController presentPopoverFromBarButtonItem:fOptionsButton - permittedArrowDirections:UIPopoverArrowDirectionAny + [fPopOverController presentPopoverFromBarButtonItem:fOptionsButton + permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; - + } else { UIBarButtonItem* backButton = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStyleBordered @@ -165,7 +172,7 @@ self.navigationController.navigationBar.topItem.title = @"Options"; } } - + //Popover Management - (void)showRootPopoverButtonItem:(UIBarButtonItem *)barButtonItem { [self.navigationItem setLeftBarButtonItem:barButtonItem animated:NO]; @@ -175,4 +182,5 @@ [self.navigationItem setLeftBarButtonItem:nil animated:NO]; } -@end \ No newline at end of file +@end + diff --git a/experimental/iOSSampleApp/Shared/skia_ios.mm b/experimental/iOSSampleApp/Shared/skia_ios.mm index b8680c40e9..6cfc349931 100644 --- a/experimental/iOSSampleApp/Shared/skia_ios.mm +++ b/experimental/iOSSampleApp/Shared/skia_ios.mm @@ -18,9 +18,9 @@ int main(int argc, char *argv[]) { NSString *resourceDir = [docsDir stringByAppendingString:@"/resources"]; const char *d = [resourceDir UTF8String]; - // change to the dcouments directory. To allow the 'writePath' flag to use relative paths. + // change to the dcouments directory. To allow the 'writePath' flag to use relative paths. NSFileManager *filemgr = [NSFileManager defaultManager]; - int retVal = 99; + int retVal = 99; if ([filemgr changeCurrentDirectoryPath: docsDir] == YES) { IOS_launch_type launchType = set_cmd_line_args(argc, argv, d); diff --git a/experimental/iOSSampleApp/SkSampleUIView.mm b/experimental/iOSSampleApp/SkSampleUIView.mm index 39eef5647c..65ddf4cb3c 100644 --- a/experimental/iOSSampleApp/SkSampleUIView.mm +++ b/experimental/iOSSampleApp/SkSampleUIView.mm @@ -38,19 +38,19 @@ public: #endif fBackend = SkOSWindow::kNone_BackEndType; } - + virtual ~SkiOSDeviceManager() { #if SK_SUPPORT_GPU SkSafeUnref(fCurContext); SkSafeUnref(fCurIntf); #endif } - + void setUpBackend(SampleWindow* win, int msaaSampleCount, bool deepColor) override { SkASSERT(SkOSWindow::kNone_BackEndType == fBackend); - + fBackend = SkOSWindow::kNone_BackEndType; - + #if SK_SUPPORT_GPU switch (win->getDeviceType()) { case SampleWindow::kRaster_DeviceType: @@ -73,7 +73,7 @@ public: fDeepColor = deepColor; // Assume that we have at least 24-bit output, for backends that don't supply this data fActualColorBits = SkTMax(info.fColorBits, 24); - + SkASSERT(NULL == fCurIntf); switch (win->getDeviceType()) { case SampleWindow::kRaster_DeviceType: @@ -86,12 +86,12 @@ public: SkASSERT(false); break; } - + SkASSERT(NULL == fCurContext); if (SkOSWindow::kNone_BackEndType != fBackend) { fCurContext = GrContext::MakeGL(fCurIntf).release(); } - + if ((NULL == fCurContext || NULL == fCurIntf) && SkOSWindow::kNone_BackEndType != fBackend) { // We need some context and interface to see results if we're using a GL backend @@ -104,15 +104,15 @@ public: // call windowSizeChanged to create the render target this->windowSizeChanged(win); } - + void tearDownBackend(SampleWindow *win) override { #if SK_SUPPORT_GPU SkSafeUnref(fCurContext); fCurContext = NULL; - + SkSafeUnref(fCurIntf); fCurIntf = NULL; - + fGpuSurface = nullptr; #endif win->release(); @@ -197,9 +197,9 @@ private: bool fDeepColor; int fActualColorBits; #endif - + SkOSWindow::SkBackEndTypes fBackend; - + typedef SampleWindow::DeviceManager INHERITED; }; @@ -214,7 +214,7 @@ private: struct FPSState { static const int FRAME_COUNT = 60; - + CFTimeInterval fNow0, fNow1; CFTimeInterval fTime0, fTime1, fTotalTime; int fFrameCounter; @@ -223,25 +223,25 @@ struct FPSState { fTime0 = fTime1 = fTotalTime = 0; fFrameCounter = 0; } - + void startDraw() { fNow0 = CACurrentMediaTime(); } - + void endDraw() { fNow1 = CACurrentMediaTime(); } - + void flush(SkOSWindow* hwnd) { CFTimeInterval now2 = CACurrentMediaTime(); - + fTime0 += fNow1 - fNow0; fTime1 += now2 - fNow1; - + if (++fFrameCounter == FRAME_COUNT) { CFTimeInterval totalNow = CACurrentMediaTime(); fTotalTime = totalNow - fTotalTime; - + //SkMSec ms0 = (int)(1000 * fTime0 / FRAME_COUNT); //SkMSec msTotal = (int)(1000 * fTotalTime / FRAME_COUNT); //str.printf(" ms: %d [%d], fps: %3.1f", msTotal, ms0, @@ -267,32 +267,32 @@ static FPSState gFPS; if (self = [super initWithDefaults]) { fRedrawRequestPending = false; fFPSState = new FPSState; - + #ifdef USE_GL_1 fGL.fContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; #else fGL.fContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; #endif - + if (!fGL.fContext || ![EAGLContext setCurrentContext:fGL.fContext]) { [self release]; return nil; } - + // Create default framebuffer object. The backing will be allocated for the current layer in -resizeFromLayer glGenFramebuffers(1, &fGL.fFramebuffer); glBindFramebuffer(GL_FRAMEBUFFER, fGL.fFramebuffer); - + glGenRenderbuffers(1, &fGL.fRenderbuffer); glGenRenderbuffers(1, &fGL.fStencilbuffer); - + glBindRenderbuffer(GL_RENDERBUFFER, fGL.fRenderbuffer); glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, fGL.fRenderbuffer); - + glBindRenderbuffer(GL_RENDERBUFFER, fGL.fStencilbuffer); glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, fGL.fStencilbuffer); - + self.fGLLayer = [CAEAGLLayer layer]; fGLLayer.bounds = self.bounds; fGLLayer.anchorPoint = CGPointMake(0, 0); @@ -304,12 +304,12 @@ static FPSState gFPS; SKGL_CONFIG, kEAGLDrawablePropertyColorFormat, nil]; - + self.fRasterLayer = [CALayer layer]; fRasterLayer.anchorPoint = CGPointMake(0, 0); fRasterLayer.opaque = TRUE; [self.layer addSublayer:fRasterLayer]; - + NSMutableDictionary *newActions = [[NSMutableDictionary alloc] initWithObjectsAndKeys:[NSNull null], @"onOrderIn", [NSNull null], @"onOrderOut", [NSNull null], @"sublayers", @@ -319,7 +319,7 @@ static FPSState gFPS; fGLLayer.actions = newActions; fRasterLayer.actions = newActions; [newActions release]; - + // rebuild argc and argv from process info NSArray* arguments = [[NSProcessInfo processInfo] arguments]; int argc = [arguments count]; @@ -330,12 +330,12 @@ static FPSState gFPS; argv[i] = new char[strlen+1]; [arg getCString:argv[i] maxLength:strlen+1 encoding:NSUTF8StringEncoding]; } - + fDevManager = new SkiOSDeviceManager(fGL.fFramebuffer); fWind = new SampleWindow(self, argc, argv, fDevManager); fWind->resize(self.frame.size.width, self.frame.size.height); - + for (int i = 0; i < argc; ++i) { delete [] argv[i]; } @@ -355,21 +355,21 @@ static FPSState gFPS; - (void)layoutSubviews { int W, H; - + // Allocate color buffer backing based on the current layer size glBindRenderbuffer(GL_RENDERBUFFER, fGL.fRenderbuffer); [fGL.fContext renderbufferStorage:GL_RENDERBUFFER fromDrawable:fGLLayer]; - + glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &fGL.fWidth); glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &fGL.fHeight); - + glBindRenderbuffer(GL_RENDERBUFFER, fGL.fStencilbuffer); glRenderbufferStorage(GL_RENDERBUFFER, GL_STENCIL_INDEX8, fGL.fWidth, fGL.fHeight); - + if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) { NSLog(@"Failed to make complete framebuffer object %x", glCheckFramebufferStatus(GL_FRAMEBUFFER)); } - + if (fDevManager->isUsingGL()) { W = fGL.fWidth; H = fGL.fHeight; @@ -382,7 +382,7 @@ static FPSState gFPS; H = (int)CGRectGetHeight(rect); fRasterLayer.bounds = rect; } - + printf("---- layoutSubviews %d %d\n", W, H); fWind->resize(W, H); fWind->inval(NULL); @@ -405,11 +405,11 @@ static FPSState gFPS; // This application only creates a single context which is already set current at this point. // This call is redundant, but needed if dealing with multiple contexts. [EAGLContext setCurrentContext:fGL.fContext]; - + // This application only creates a single default framebuffer which is already bound at this point. // This call is redundant, but needed if dealing with multiple framebuffers. glBindFramebuffer(GL_FRAMEBUFFER, fGL.fFramebuffer); - + GLint scissorEnable; glGetIntegerv(GL_SCISSOR_TEST, &scissorEnable); glDisable(GL_SCISSOR_TEST); @@ -419,8 +419,8 @@ static FPSState gFPS; glEnable(GL_SCISSOR_TEST); } glViewport(0, 0, fGL.fWidth, fGL.fHeight); - - + + sk_sp surface(fWind->makeSurface()); SkCanvas* canvas = surface->getCanvas(); @@ -449,7 +449,7 @@ static FPSState gFPS; - (void)forceRedraw { if (fDevManager->isUsingGL()) [self drawInGL]; - else + else [self drawInRaster]; } @@ -459,9 +459,9 @@ static FPSState gFPS; NSString* text = [NSString stringWithUTF8String:title]; if ([text length] > 0) self.fTitle = text; - + if (fTitleItem && fTitle) { - fTitleItem.title = [NSString stringWithFormat:@"%@%@", fTitle, + fTitleItem.title = [NSString stringWithFormat:@"%@%@", fTitle, [NSString stringWithUTF8String:fFPSState->str.c_str()]]; } } diff --git a/experimental/tools/mskp_parser.py b/experimental/tools/mskp_parser.py index 051e579190..e9698f2288 100755 --- a/experimental/tools/mskp_parser.py +++ b/experimental/tools/mskp_parser.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # Copyright 2016 Google Inc. -# +# # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/gm/cgm.c b/gm/cgm.c index 5e57225b64..bbd170b9d3 100644 --- a/gm/cgm.c +++ b/gm/cgm.c @@ -29,21 +29,21 @@ static sk_shader_t* make_shader() { static void do_draw(sk_canvas_t* canvas) { sk_paint_t* paint = sk_paint_new(); sk_paint_set_antialias(paint, true); - + sk_paint_set_color(paint, 0xFFFFFFFF); sk_canvas_draw_paint(canvas, paint); - + sk_rect_t r = { 10, 10, W - 10, H - 10 }; - + sk_paint_set_color(paint, 0xFFFF0000); sk_canvas_draw_rect(canvas, &r, paint); - + sk_shader_t* shader = make_shader(); sk_paint_set_shader(paint, shader); sk_shader_unref(shader); - + sk_canvas_draw_oval(canvas, &r, paint); - + sk_paint_delete(paint); } diff --git a/gm/dashing.cpp b/gm/dashing.cpp index 68fe7f168f..a46d31f471 100644 --- a/gm/dashing.cpp +++ b/gm/dashing.cpp @@ -512,7 +512,7 @@ DEF_SIMPLE_GM(longpathdash, canvas, 612, 612) { p.setStrokeWidth(1); const SkScalar intervals[] = { 1, 1 }; p.setPathEffect(SkDashPathEffect::Make(intervals, SK_ARRAY_COUNT(intervals), 0)); - + canvas->translate(50, 50); canvas->drawPath(lines, p); } diff --git a/gm/hardstop_gradients.cpp b/gm/hardstop_gradients.cpp index 2ab2ed9c89..84b7ab8aab 100644 --- a/gm/hardstop_gradients.cpp +++ b/gm/hardstop_gradients.cpp @@ -58,7 +58,7 @@ const int RECT_HEIGHT = CELL_HEIGHT - (2 * PAD_HEIGHT); static void shade_rect(SkCanvas* canvas, sk_sp shader, int cellRow, int cellCol) { SkPaint paint; paint.setShader(shader); - + SkRect rect = SkRect::MakeXYWH(SkIntToScalar(cellCol * CELL_WIDTH + PAD_WIDTH), SkIntToScalar(cellRow * CELL_HEIGHT + PAD_HEIGHT), SkIntToScalar(RECT_WIDTH), @@ -154,7 +154,7 @@ protected: shade_rect(canvas, shader, cellRow, cellCol); } - } + } } private: diff --git a/gm/reveal.cpp b/gm/reveal.cpp index a793b2da54..eb08a3f8a8 100644 --- a/gm/reveal.cpp +++ b/gm/reveal.cpp @@ -28,7 +28,7 @@ constexpr int kClipOffset = 32; class Object { public: virtual ~Object() {} - // When it returns true, this call will have placed a device-space _circle, rect or + // When it returns true, this call will have placed a device-space _circle, rect or // simple circular_ RRect in "rr" virtual bool asDevSpaceRRect(const SkMatrix& ctm, SkRRect* rr) const = 0; virtual SkPath asPath(SkScalar inset) const = 0; @@ -173,7 +173,7 @@ public: return true; } - SkPath asPath(SkScalar inset) const override { + SkPath asPath(SkScalar inset) const override { SkRRect tmp = fRRect; tmp.inset(inset, inset); @@ -221,7 +221,7 @@ public: return true; } - SkPath asPath(SkScalar inset) const override { + SkPath asPath(SkScalar inset) const override { SkRect tmp = fRect; tmp.inset(inset, inset); @@ -382,7 +382,7 @@ protected: std::unique_ptr clipObj((*clipMakes[x])(clipRect)); std::unique_ptr drawObj((*drawMakes[y])(cell)); - // The goal is to replace this clipped draw (which clips the + // The goal is to replace this clipped draw (which clips the // shadow) with a draw using the geometric clip if (kBlurMask_Mode == fMode) { SkPath clippedPath; @@ -488,8 +488,8 @@ protected: case 'G': fCoverageGeom = (CoverageGeom) ((fCoverageGeom+1) % kCoverageGeomCount); return true; - } - + } + return false; } diff --git a/gm/skbug_5321.cpp b/gm/skbug_5321.cpp index 0e39a685b2..740c4f4b24 100644 --- a/gm/skbug_5321.cpp +++ b/gm/skbug_5321.cpp @@ -13,13 +13,13 @@ DEF_SIMPLE_GM(skbug_5321, canvas, 128, 128) { SkPaint paint; paint.setStyle(SkPaint::kFill_Style); paint.setTextSize(30); - + paint.setTextEncoding(SkPaint::kUTF8_TextEncoding); const char text[] = "x\314\200y"; // utf8(u"x\u0300y") SkScalar x = 20, y = 45; size_t byteLength = strlen(text); canvas->drawText(text, byteLength, x, y, paint); - + int glyph_count = paint.countText(text, byteLength); SkAutoTMalloc widths(glyph_count); (void)paint.getTextWidths(text, byteLength, &widths[0]); diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index f2a271c5ef..69e22dcbda 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -1542,7 +1542,7 @@ public: @param constraint filter strictly within image or draw faster */ void drawImageRect(const sk_sp& image, const SkIRect& isrc, const SkRect& dst, - const SkPaint* paint, + const SkPaint* paint, SrcRectConstraint constraint = kStrict_SrcRectConstraint) { this->drawImageRect(image.get(), isrc, dst, paint, constraint); } @@ -1696,7 +1696,7 @@ public: @param constraint sample strictly within isrc, or draw faster */ void drawBitmapRect(const SkBitmap& bitmap, const SkIRect& isrc, const SkRect& dst, - const SkPaint* paint, + const SkPaint* paint, SrcRectConstraint constraint = kStrict_SrcRectConstraint); /** Draw SkBitmap bitmap, scaled and translated to fill SkRect dst. diff --git a/include/core/SkColorPriv.h b/include/core/SkColorPriv.h index 980a47e4e1..0cd02e8034 100644 --- a/include/core/SkColorPriv.h +++ b/include/core/SkColorPriv.h @@ -67,7 +67,7 @@ static inline U8CPU SkUnitScalarClampToByte(SkScalar x) { #define SK_RGBA_A32_SHIFT 24 #endif -#define SkGetPackedA32(packed) ((uint32_t)((packed) << (24 - SK_A32_SHIFT)) >> 24) +#define SkGetPackedA32(packed) ((uint32_t)((packed) << (24 - SK_A32_SHIFT)) >> 24) #define SkGetPackedR32(packed) ((uint32_t)((packed) << (24 - SK_R32_SHIFT)) >> 24) #define SkGetPackedG32(packed) ((uint32_t)((packed) << (24 - SK_G32_SHIFT)) >> 24) #define SkGetPackedB32(packed) ((uint32_t)((packed) << (24 - SK_B32_SHIFT)) >> 24) diff --git a/include/core/SkDrawable.h b/include/core/SkDrawable.h index 6b9bf7ee34..b6beca910e 100644 --- a/include/core/SkDrawable.h +++ b/include/core/SkDrawable.h @@ -66,7 +66,7 @@ public: protected: virtual SkRect onGetBounds() = 0; virtual void onDraw(SkCanvas*) = 0; - + /** * Default implementation calls onDraw() with a canvas that records into a picture. Subclasses * may override if they have a more efficient way to return a picture for the current state diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h index 60000798e4..0991bea63f 100644 --- a/include/core/SkImageFilter.h +++ b/include/core/SkImageFilter.h @@ -95,7 +95,7 @@ public: * Apply this cropRect to the imageBounds. If a given edge of the cropRect is not * set, then the corresponding edge from imageBounds will be used. If "embiggen" * is true, the crop rect is allowed to enlarge the size of the rect, otherwise - * it may only reduce the rect. Filters that can affect transparent black should + * it may only reduce the rect. Filters that can affect transparent black should * pass "true", while all other filters should pass "false". * * Note: imageBounds is in "device" space, as the output cropped rectangle will be, @@ -342,7 +342,7 @@ protected: // calls filterImage() on that input, and returns the result. sk_sp filterInput(int index, SkSpecialImage* src, - const Context&, + const Context&, SkIPoint* offset) const; /** diff --git a/include/core/SkImageInfo.h b/include/core/SkImageInfo.h index fa3797bbb5..5e9e80fcdc 100644 --- a/include/core/SkImageInfo.h +++ b/include/core/SkImageInfo.h @@ -117,7 +117,7 @@ static int SkColorTypeShiftPerPixel(SkColorType ct) { }; static_assert(SK_ARRAY_COUNT(gShift) == (size_t)(kLastEnum_SkColorType + 1), "size_mismatch_with_SkColorType_enum"); - + SkASSERT((size_t)ct < SK_ARRAY_COUNT(gShift)); return gShift[ct]; } @@ -225,7 +225,7 @@ public: static SkImageInfo MakeUnknown() { return MakeUnknown(0, 0); } - + int width() const { return fWidth; } int height() const { return fHeight; } SkColorType colorType() const { return fColorType; } @@ -257,7 +257,7 @@ public: SkImageInfo makeAlphaType(SkAlphaType newAlphaType) const { return Make(fWidth, fHeight, fColorType, newAlphaType, fColorSpace); } - + SkImageInfo makeColorType(SkColorType newColorType) const { return Make(fWidth, fHeight, newColorType, fAlphaType, fColorSpace); } diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h index 2e09f4d37c..6e9f421264 100644 --- a/include/core/SkMatrix.h +++ b/include/core/SkMatrix.h @@ -569,7 +569,7 @@ public: * scale and translate elements. If it contains other elements, the results are undefined. */ void mapRectScaleTranslate(SkRect* dst, const SkRect& src) const; - + /** Return the mean radius of a circle after it has been mapped by this matrix. NOTE: in perspective this value assumes the circle has its center at the origin. @@ -721,15 +721,15 @@ public: fMat[kMScaleX] = sx; fMat[kMSkewX] = 0; fMat[kMTransX] = tx; - + fMat[kMSkewY] = 0; fMat[kMScaleY] = sy; fMat[kMTransY] = ty; - + fMat[kMPersp0] = 0; fMat[kMPersp1] = 0; fMat[kMPersp2] = 1; - + unsigned mask = 0; if (sx != 1 || sy != 1) { mask |= kScale_Mask; @@ -739,7 +739,7 @@ public: } this->setTypeMask(mask | kRectStaysRect_Mask); } - + /** * Are all elements of the matrix finite? */ diff --git a/include/core/SkPoint.h b/include/core/SkPoint.h index 2cc57126f2..4aceff7a49 100644 --- a/include/core/SkPoint.h +++ b/include/core/SkPoint.h @@ -215,13 +215,13 @@ struct SK_API SkPoint { void setRectFan(SkScalar l, SkScalar t, SkScalar r, SkScalar b, size_t stride) { SkASSERT(stride >= sizeof(SkPoint)); - + ((SkPoint*)((intptr_t)this + 0 * stride))->set(l, t); ((SkPoint*)((intptr_t)this + 1 * stride))->set(l, b); ((SkPoint*)((intptr_t)this + 2 * stride))->set(r, b); ((SkPoint*)((intptr_t)this + 3 * stride))->set(r, t); } - + static void Offset(SkPoint points[], int count, const SkPoint& offset) { Offset(points, count, offset.fX, offset.fY); @@ -351,13 +351,13 @@ struct SK_API SkPoint { SkPoint operator*(SkScalar scale) const { return Make(fX * scale, fY * scale); } - + SkPoint& operator*=(SkScalar scale) { fX *= scale; fY *= scale; return *this; } - + /** * Returns true if both X and Y are finite (not infinity or NaN) */ diff --git a/include/core/SkPoint3.h b/include/core/SkPoint3.h index af24a8df58..6f69f1c4ea 100644 --- a/include/core/SkPoint3.h +++ b/include/core/SkPoint3.h @@ -57,7 +57,7 @@ struct SK_API SkPoint3 { /** Scale the point's coordinates by scale. */ - void scale(SkScalar value) { + void scale(SkScalar value) { fX *= value; fY *= value; fZ *= value; diff --git a/include/core/SkRSXform.h b/include/core/SkRSXform.h index dffbc59d39..706617e313 100644 --- a/include/core/SkRSXform.h +++ b/include/core/SkRSXform.h @@ -45,7 +45,7 @@ struct SkRSXform { bool rectStaysRect() const { return 0 == fSCos || 0 == fSSin; } - + void setIdentity() { fSCos = 1; fSSin = fTx = fTy = 0; diff --git a/include/core/SkRWBuffer.h b/include/core/SkRWBuffer.h index a938db20b0..e59a56bda0 100644 --- a/include/core/SkRWBuffer.h +++ b/include/core/SkRWBuffer.h @@ -50,7 +50,7 @@ public: * block, or false if the iterator is exhausted. */ bool next(); - + private: const SkBufferBlock* fBlock; size_t fRemaining; @@ -101,7 +101,7 @@ public: #else void validate() const {} #endif - + private: SkBufferHead* fHead; SkBufferBlock* fTail; diff --git a/include/effects/SkLayerRasterizer.h b/include/effects/SkLayerRasterizer.h index 7fcfd6b2f0..cd48602357 100644 --- a/include/effects/SkLayerRasterizer.h +++ b/include/effects/SkLayerRasterizer.h @@ -57,7 +57,7 @@ public: * The caller is responsible for calling unref() on the returned object, if non NULL. */ sk_sp snapshot() const; - + private: SkDeque* fLayers; }; diff --git a/include/effects/SkRRectsGaussianEdgeMaskFilter.h b/include/effects/SkRRectsGaussianEdgeMaskFilter.h index 14e17b3deb..d9e30248e2 100644 --- a/include/effects/SkRRectsGaussianEdgeMaskFilter.h +++ b/include/effects/SkRRectsGaussianEdgeMaskFilter.h @@ -18,7 +18,7 @@ public: * of the intersection of two round rects. * Currently this is only useable with round rects that have the same radii at * all the corners and for which the x & y radii are equal. - * + * * In order to minimize fill the coverage geometry that should be drawn should be no larger * than the intersection of the bounding boxes of the two round rects. Ambitious users can * omit the center area of the coverage geometry if it is known to be occluded. diff --git a/include/gpu/GrColor.h b/include/gpu/GrColor.h index ad66523bcb..b4a461d738 100644 --- a/include/gpu/GrColor.h +++ b/include/gpu/GrColor.h @@ -155,7 +155,7 @@ static inline GrColor GrPremulColor(GrColor color) { static inline GrColor GrUnpremulColor(GrColor color) { GrColorIsPMAssert(color); unsigned r = GrColorUnpackR(color); - unsigned g = GrColorUnpackG(color); + unsigned g = GrColorUnpackG(color); unsigned b = GrColorUnpackB(color); unsigned a = GrColorUnpackA(color); SkPMColor colorPM = SkPackARGB32(a, r, g, b); diff --git a/include/gpu/vk/GrVkBackendContext.h b/include/gpu/vk/GrVkBackendContext.h index 429319c31c..68791ba945 100644 --- a/include/gpu/vk/GrVkBackendContext.h +++ b/include/gpu/vk/GrVkBackendContext.h @@ -31,8 +31,8 @@ enum GrVkFeatureFlags { // The BackendContext contains all of the base Vulkan objects needed by the GrVkGpu. The assumption // is that the client will set these up and pass them to the GrVkGpu constructor. The VkDevice -// created must support at least one graphics queue, which is passed in as well. -// The QueueFamilyIndex must match the family of the given queue. It is needed for CommandPool +// created must support at least one graphics queue, which is passed in as well. +// The QueueFamilyIndex must match the family of the given queue. It is needed for CommandPool // creation, and any GrBackendObjects handed to us (e.g., for wrapped textures) need to be created // in or transitioned to that family. struct GrVkBackendContext : public SkRefCnt { diff --git a/include/pathops/SkPathOps.h b/include/pathops/SkPathOps.h index 1e8093f2a8..c672290570 100644 --- a/include/pathops/SkPathOps.h +++ b/include/pathops/SkPathOps.h @@ -76,12 +76,12 @@ public: @param path The second operand. @param _operator The operator to apply to the existing and supplied paths. - */ + */ void add(const SkPath& path, SkPathOp _operator); /** Computes the sum of all paths and operands, and resets the builder to its initial state. - + @param result The product of the operands. @return True if the operation succeeded. */ diff --git a/include/private/GrAuditTrail.h b/include/private/GrAuditTrail.h index 05f6fc5aca..c6175501e1 100644 --- a/include/private/GrAuditTrail.h +++ b/include/private/GrAuditTrail.h @@ -23,13 +23,13 @@ class GrOp; * to json. * * Capturing this information is expensive and consumes a lot of memory, therefore it is important - * to enable auditing only when required and disable it promptly. The AutoEnable class helps to + * to enable auditing only when required and disable it promptly. The AutoEnable class helps to * ensure that the audit trail is disabled in a timely fashion. Once the information has been dealt * with, be sure to call reset(), or the log will simply keep growing. */ class GrAuditTrail { public: - GrAuditTrail() + GrAuditTrail() : fClientID(kGrAuditTrailInvalidID) , fEnabled(false) {} diff --git a/include/utils/SkDumpCanvas.h b/include/utils/SkDumpCanvas.h index 2988aaaeb2..8a28c61412 100644 --- a/include/utils/SkDumpCanvas.h +++ b/include/utils/SkDumpCanvas.h @@ -59,7 +59,7 @@ public: */ class Dumper : public SkRefCnt { public: - + virtual void dump(SkDumpCanvas*, SkDumpCanvas::Verb, const char str[], const SkPaint*) = 0; diff --git a/include/utils/SkTextBox.h b/include/utils/SkTextBox.h index 90903b558d..885800ce6a 100644 --- a/include/utils/SkTextBox.h +++ b/include/utils/SkTextBox.h @@ -67,7 +67,7 @@ public: virtual ~Visitor() {} virtual void operator()(const char*, size_t, SkScalar x, SkScalar y, const SkPaint&) = 0; }; - + private: SkRect fBox; SkScalar fSpacingMul, fSpacingAdd; diff --git a/include/views/SkEventSink.h b/include/views/SkEventSink.h index 9714532f97..bf974f6e5c 100644 --- a/include/views/SkEventSink.h +++ b/include/views/SkEventSink.h @@ -21,7 +21,7 @@ struct SkTagList; */ class SkEventSink : public SkRefCnt { public: - + SkEventSink(); virtual ~SkEventSink(); diff --git a/infra/bots/zip_utils_test.py b/infra/bots/zip_utils_test.py index 4f88a115df..bad9c2fd2a 100644 --- a/infra/bots/zip_utils_test.py +++ b/infra/bots/zip_utils_test.py @@ -31,7 +31,7 @@ class ZipUtilsTest(unittest.TestCase): fw.write('b.txt', 0751) fw.write('c.txt', 0640) fw.write(os.path.join('subdir', 'd.txt'), 0640) - + # Zip, unzip. zip_utils.zip('input', 'test.zip') zip_utils.unzip('test.zip', 'output') diff --git a/samplecode/PerlinPatch.cpp b/samplecode/PerlinPatch.cpp index acc1a4a719..d20a0fb838 100644 --- a/samplecode/PerlinPatch.cpp +++ b/samplecode/PerlinPatch.cpp @@ -147,7 +147,7 @@ protected: { fTexX + texWidth, fTexY + texHeight}, { fTexX - texWidth, fTexY + texHeight}} ; - + SkScalar scaleFreq = 2.0; fShader1 = SkPerlinNoiseShader::MakeImprovedNoise(fXFreq/scaleFreq, fYFreq/scaleFreq, 4, fSeed); diff --git a/samplecode/SampleAAGeometry.cpp b/samplecode/SampleAAGeometry.cpp index 5b07665129..350d3c880f 100644 --- a/samplecode/SampleAAGeometry.cpp +++ b/samplecode/SampleAAGeometry.cpp @@ -616,11 +616,11 @@ struct UniControl { struct BiControl : public UniControl { SkScalar fValHi; - BiControl(const char* name, SkScalar min, SkScalar max) + BiControl(const char* name, SkScalar min, SkScalar max) : UniControl(name, min, max) , fValHi(fMax) { } - + virtual ~BiControl() {} virtual void draw(SkCanvas* canvas, const ControlPaints& paints) { @@ -683,7 +683,7 @@ public: MyClick(SkView* target, ClickType type, ControlType control) : Click(target) - , fType(type) + , fType(type) , fControl(control) , fVerb((SkPath::Verb) -1) , fWeight(1) { @@ -691,7 +691,7 @@ public: MyClick(SkView* target, ClickType type, int index) : Click(target) - , fType(type) + , fType(type) , fControl((ControlType) index) , fVerb((SkPath::Verb) -1) , fWeight(1) { @@ -699,7 +699,7 @@ public: MyClick(SkView* target, ClickType type, int index, SkPath::Verb verb, SkScalar weight) : Click(target) - , fType(type) + , fType(type) , fControl((ControlType) index) , fVerb(verb) , fWeight(weight) { @@ -819,7 +819,7 @@ class AAGeometryView : public SampleView { public: - AAGeometryView() + AAGeometryView() : fResControl("error", 0, 10) , fWeightControl("weight", 0, 5) , fWidthControl("width", FLT_EPSILON, 100) @@ -942,7 +942,7 @@ public: SET_CONTROL(Filter); SET_CONTROL(Weight); } - + #undef SET_CONTROL void set_buttonList(int index, Button* button, MyClick::ControlType type) { @@ -973,7 +973,7 @@ public: // overrides from SkEventSink bool onQuery(SkEvent* evt) override; - + void onSizeChange() override { setControlButtonsPos(); this->INHERITED::onSizeChange(); @@ -1173,7 +1173,7 @@ public: foundFirst = false; } break; - default: + default: break; } if (SkPath::kLine_Verb <= verb && verb <= SkPath::kCubic_Verb) { @@ -1228,7 +1228,7 @@ public: canvas->drawPath(cPath, complex ? fComplexPaint : fActivePaint); draw_points(canvas, pts, 4); } break; - default: + default: break; } return; @@ -1289,7 +1289,7 @@ public: return counter; } } break; - default: + default: break; } } @@ -1400,7 +1400,7 @@ public: case SkPath::kCubic_Verb: cubic_coverage(pts, distanceMap, w, h); break; - default: + default: break; } } @@ -1513,7 +1513,7 @@ public: if (!outPath.getBounds().intersects(inPath.getBounds())) { continue; } - + } } } @@ -1804,9 +1804,9 @@ static struct KeyCommand { const char* fDescriptionR; bool (AAGeometryView::*fFunction)(); } kKeyCommandList[] = { - { ' ', 0, "space", "center path", &AAGeometryView::scaleToFit }, - { '-', 0, "-", "zoom out", &AAGeometryView::scaleDown }, - { '+', '=', "+/=", "zoom in", &AAGeometryView::scaleUp }, + { ' ', 0, "space", "center path", &AAGeometryView::scaleToFit }, + { '-', 0, "-", "zoom out", &AAGeometryView::scaleDown }, + { '+', '=', "+/=", "zoom in", &AAGeometryView::scaleUp }, { 'd', 0, "d", "dump to console", &AAGeometryView::pathDump }, { 'h', 0, "h", "hide controls", &AAGeometryView::hideAll }, { 'r', 0, "r", "reset path", &AAGeometryView::constructPath }, @@ -1869,5 +1869,5 @@ bool AAGeometryView::onQuery(SkEvent* evt) { } return this->INHERITED::onQuery(evt); } - + DEF_SAMPLE( return new AAGeometryView; ) diff --git a/samplecode/SampleBigGradient.cpp b/samplecode/SampleBigGradient.cpp index 9d850c905a..301c3d8a29 100644 --- a/samplecode/SampleBigGradient.cpp +++ b/samplecode/SampleBigGradient.cpp @@ -93,7 +93,7 @@ public: void drawRect(const SkRect& r, SkColor c) override { CGContextRef cg = (CGContextRef)fCanvas->accessTopRasterHandle(); - + CGColorRef color = CGColorCreateGenericRGB(SkColorGetR(c)/255.f, SkColorGetG(c)/255.f, SkColorGetB(c)/255.f, @@ -121,7 +121,7 @@ static CGAffineTransform matrix_to_transform(CGContextRef cg, const SkMatrix& ct class Allocator_CG : public SkRasterHandleAllocator { public: Allocator_CG() {} - + bool allocHandle(const SkImageInfo& info, Rec* rec) override { // let CG allocate the pixels CGContextRef cg = SkCreateCGContext(SkPixmap(info, nullptr, 0)); @@ -139,7 +139,7 @@ public: void updateHandle(Handle hndl, const SkMatrix& ctm, const SkIRect& clip) override { CGContextRef cg = (CGContextRef)hndl; - + CGContextRestoreGState(cg); CGContextSaveGState(cg); CGContextClipToRect(cg, CGRectMake(clip.x(), clip.y(), clip.width(), clip.height())); @@ -282,7 +282,7 @@ protected: port->drawRect({0, 0, 30, 30}, SK_ColorBLUE); port->drawOval({10, 10, 20, 20}, SK_ColorWHITE); port->restore(); - + port->saveLayer({50, 50, 100, 100}, 0x80); port->drawRect({55, 55, 95, 95}, SK_ColorGREEN); port->restore(); diff --git a/samplecode/SampleCowboy.cpp b/samplecode/SampleCowboy.cpp index 1191cd4d3e..b1eec87e50 100644 --- a/samplecode/SampleCowboy.cpp +++ b/samplecode/SampleCowboy.cpp @@ -29,13 +29,13 @@ public: protected: static constexpr auto kAnimationIterations = 5; - + enum State { kZoomIn, kScroll, kZoomOut }; - + void onOnceBeforeDraw() override { fPath = GetResourcePath("Cowboy.svg"); SkFILEStream svgStream(fPath.c_str()); @@ -79,7 +79,7 @@ protected: canvas->concat(SkMatrix::MakeScale(fDelta)); break; } - + fDom->render(canvas); } } @@ -100,12 +100,12 @@ protected: return this->INHERITED::onQuery(evt); } - + bool onAnimate(const SkAnimTimer& timer) override { if (!fDom) { return false; } - + --fAnimationLoop; if (fAnimationLoop == 0) { fAnimationLoop = kAnimationIterations; @@ -126,7 +126,7 @@ protected: } return true; } - + private: sk_sp fDom; SkString fPath; diff --git a/samplecode/SamplePath.cpp b/samplecode/SamplePath.cpp index 0fb528774b..ec92fdfc1a 100644 --- a/samplecode/SamplePath.cpp +++ b/samplecode/SamplePath.cpp @@ -334,7 +334,7 @@ public: N = 4 }; SkPoint fPts[N]; - + FatStroke() : fClosed(false), fShowStroke(true), fShowHidden(false), fShowSkeleton(true), fJoinType(0), fCapType(0) { @@ -343,35 +343,35 @@ public: fPts[i].fX = 20 + rand.nextUScalar1() * 640; fPts[i].fY = 20 + rand.nextUScalar1() * 480; } - + fPtsPaint.setAntiAlias(true); fPtsPaint.setStrokeWidth(10); fPtsPaint.setStrokeCap(SkPaint::kRound_Cap); - + fHiddenPaint.setAntiAlias(true); fHiddenPaint.setStyle(SkPaint::kStroke_Style); fHiddenPaint.setColor(0xFF0000FF); - + fStrokePaint.setAntiAlias(true); fStrokePaint.setStyle(SkPaint::kStroke_Style); fStrokePaint.setStrokeWidth(50); fStrokePaint.setColor(0x8000FF00); - + fSkeletonPaint.setAntiAlias(true); fSkeletonPaint.setStyle(SkPaint::kStroke_Style); fSkeletonPaint.setColor(SK_ColorRED); } - + void toggle(bool& value) { value = !value; this->inval(nullptr); } - + void toggle3(int& value) { value = (value + 1) % 3; this->inval(nullptr); } - + protected: // overrides from SkEventSink bool onQuery(SkEvent* evt) override { @@ -395,7 +395,7 @@ protected: } return this->INHERITED::onQuery(evt); } - + void makePath(SkPath* path) { path->moveTo(fPts[0]); for (int i = 1; i < N; ++i) { @@ -405,7 +405,7 @@ protected: path->close(); } } - + void onDrawContent(SkCanvas* canvas) override { canvas->drawColor(0xFFEEEEEE); @@ -429,7 +429,7 @@ protected: } canvas->drawPoints(SkCanvas::kPoints_PointMode, N, fPts, fPtsPaint); } - + bool onClick(Click* click) override { int32_t index; if (click->fMeta.findS32("index", &index)) { @@ -440,7 +440,7 @@ protected: } return false; } - + SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned modi) override { const SkScalar tol = 4; const SkRect r = SkRect::MakeXYWH(x - tol, y - tol, tol * 2, tol * 2); @@ -453,7 +453,7 @@ protected: } return this->INHERITED::onFindClickHandler(x, y, modi); } - + private: typedef SampleView INHERITED; }; diff --git a/samplecode/SamplePictFile.cpp b/samplecode/SamplePictFile.cpp index 0c08fd74eb..9c82b4b420 100644 --- a/samplecode/SamplePictFile.cpp +++ b/samplecode/SamplePictFile.cpp @@ -45,7 +45,7 @@ public: ~PictFileView() override { this->freePictures(); } - + void freePictures() { for (int i = 0; i < kBBoxTypeCount; ++i) { SkSafeUnref(fPictures[i]); diff --git a/src/codec/SkRawCodec.cpp b/src/codec/SkRawCodec.cpp index dfbd7e996a..5f3d469b5d 100644 --- a/src/codec/SkRawCodec.cpp +++ b/src/codec/SkRawCodec.cpp @@ -184,7 +184,7 @@ class SkRawStream { public: virtual ~SkRawStream() {} - /* + /* * Gets the length of the stream. Depending on the type of stream, this may require reading to * the end of the stream. */ diff --git a/src/core/SkBitmapCache.cpp b/src/core/SkBitmapCache.cpp index 0fc0c9e075..210787e47d 100644 --- a/src/core/SkBitmapCache.cpp +++ b/src/core/SkBitmapCache.cpp @@ -193,7 +193,7 @@ public: SkASSERT(rec->fMalloc != nullptr); } } - + bool install(SkBitmap* bitmap) { SkAutoMutexAcquire ama(fMutex); diff --git a/src/core/SkBuffer.cpp b/src/core/SkBuffer.cpp index b7cf8b2b87..51ab239afe 100644 --- a/src/core/SkBuffer.cpp +++ b/src/core/SkBuffer.cpp @@ -35,7 +35,7 @@ bool SkRBuffer::skipToAlign4() { return false; } } - + /////////////////////////////////////////////////////////////////////////////////////////////////// void* SkWBuffer::skip(size_t size) { diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index f1b42e6975..fdfd5a4007 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -1440,7 +1440,7 @@ void SkCanvas::onClipRRect(const SkRRect& rrect, SkClipOp op, ClipEdgeStyle edge AutoValidateClip avc(this); bool isAA = kSoft_ClipEdgeStyle == edgeStyle; - + FOR_EACH_TOP_DEVICE(device->clipRRect(rrect, op, isAA)); fMCRec->fRasterClip.op(rrect, fMCRec->fMatrix, this->getTopLayerBounds(), (SkRegion::Op)op, @@ -1477,7 +1477,7 @@ void SkCanvas::onClipPath(const SkPath& path, SkClipOp op, ClipEdgeStyle edgeSty AutoValidateClip avc(this); bool isAA = kSoft_ClipEdgeStyle == edgeStyle; - + FOR_EACH_TOP_DEVICE(device->clipPath(path, op, isAA)); const SkPath* rasterClipPath = &path; diff --git a/src/core/SkColorSpace_ICC.cpp b/src/core/SkColorSpace_ICC.cpp index 5a510903c6..72592d6444 100644 --- a/src/core/SkColorSpace_ICC.cpp +++ b/src/core/SkColorSpace_ICC.cpp @@ -652,7 +652,7 @@ static bool load_color_lut(sk_sp* colorLUT, uint32_t inputCh * 3x3 matrix with no translation * * @param matrix The matrix to store the result in - * @param src Data to load the matrix out of. + * @param src Data to load the matrix out of. * @param len The length of |src|. * Must have 48 bytes if |translate| is set and 36 bytes otherwise. * @param translate Whether to read the translation column or not @@ -679,7 +679,7 @@ static bool load_matrix(SkMatrix44* matrix, const uint8_t* src, size_t len, bool default: encodingFactor = 1.f; SkASSERT(false); - break; + break; } float array[16]; array[ 0] = encodingFactor * SkFixedToFloat(read_big_endian_i32(src)); @@ -1100,7 +1100,7 @@ bool load_a2b0_lutn_type(std::vector* elements, const inTableEntries = read_big_endian_u16(src + 48); outTableEntries = read_big_endian_u16(src + 50); precision = 2; - + constexpr size_t kMaxLut16GammaEntries = 4096; if (inTableEntries < 2) { SkColorSpacePrintf("Too few (%d) input gamma table entries. Must have at least 2.\n", @@ -1111,7 +1111,7 @@ bool load_a2b0_lutn_type(std::vector* elements, const inTableEntries, kMaxLut16GammaEntries); return false; } - + if (outTableEntries < 2) { SkColorSpacePrintf("Too few (%d) output gamma table entries. Must have at least 2.\n", outTableEntries); diff --git a/src/core/SkGeometry.cpp b/src/core/SkGeometry.cpp index caae8398f1..0b3eedab17 100644 --- a/src/core/SkGeometry.cpp +++ b/src/core/SkGeometry.cpp @@ -1185,7 +1185,7 @@ int SkConic::computeQuadPOW2(SkScalar tol) const { return pow2; } -// This was originally developed and tested for pathops: see SkOpTypes.h +// This was originally developed and tested for pathops: see SkOpTypes.h // returns true if (a <= b <= c) || (a >= b >= c) static bool between(SkScalar a, SkScalar b, SkScalar c) { return (a - b) * (c - b) <= 0; @@ -1425,7 +1425,7 @@ int SkConic::BuildUnitArc(const SkVector& uStart, const SkVector& uStop, SkRotat if (!lastQ.equalsWithinTolerance(offCurve)) { dst[conicCount].set(lastQ, offCurve, finalP, cosThetaOver2); conicCount += 1; - } + } } // now handle counter-clockwise and the initial unitStart rotation diff --git a/src/core/SkMatrixPriv.h b/src/core/SkMatrixPriv.h index 844901c011..ee6f8a153d 100644 --- a/src/core/SkMatrixPriv.h +++ b/src/core/SkMatrixPriv.h @@ -27,7 +27,7 @@ public: return true; } // Insert other special-cases here (e.g. scale+translate) - + // general case SkMatrix inverse; if (mx.invert(&inverse)) { @@ -42,7 +42,7 @@ public: SkASSERT(0 == stride % sizeof(SkScalar)); SkMatrix::TypeMask tm = mx.getType(); - + if (SkMatrix::kIdentity_Mask == tm) { return; } @@ -57,7 +57,7 @@ public: return; } // Insert other special-cases here (e.g. scale+translate) - + // general case SkMatrix::MapXYProc proc = mx.getMapXYProc(); for (int i = 0; i < count; ++i) { diff --git a/src/core/SkPaintPriv.h b/src/core/SkPaintPriv.h index 663ed2d836..72c9274859 100644 --- a/src/core/SkPaintPriv.h +++ b/src/core/SkPaintPriv.h @@ -62,7 +62,7 @@ public: static void MakeTextMatrix(SkMatrix* matrix, const SkPaint& paint) { MakeTextMatrix(matrix, paint.getTextSize(), paint.getTextScaleX(), paint.getTextSkewX()); } - + static bool ShouldDither(const SkPaint&, SkColorType); }; diff --git a/src/core/SkPathEffect.cpp b/src/core/SkPathEffect.cpp index ec5ac3b945..3eee6656dd 100644 --- a/src/core/SkPathEffect.cpp +++ b/src/core/SkPathEffect.cpp @@ -104,7 +104,7 @@ public: } return fPE0->filterPath(dst, *ptr, rec, cullRect); } - + SK_TO_STRING_OVERRIDE() SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkComposePathEffect) @@ -170,7 +170,7 @@ public: return fPE0->filterPath(dst, src, rec, cullRect) | fPE1->filterPath(dst, src, rec, cullRect); } - + SK_TO_STRING_OVERRIDE() SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkSumPathEffect) diff --git a/src/core/SkPictureData.cpp b/src/core/SkPictureData.cpp index 69ff736fcf..40ce54e4d8 100644 --- a/src/core/SkPictureData.cpp +++ b/src/core/SkPictureData.cpp @@ -95,7 +95,7 @@ SkPictureData::SkPictureData(const SkPictureRecord& record, fVerticesRefs[i] = SkRef(verts[i]); } } - + const SkTDArray& imgs = record.getImageRefs(); fImageCount = imgs.count(); if (fImageCount > 0) { diff --git a/src/core/SkReadBuffer.h b/src/core/SkReadBuffer.h index 2541b54202..28f7ecba17 100644 --- a/src/core/SkReadBuffer.h +++ b/src/core/SkReadBuffer.h @@ -223,7 +223,7 @@ public: void setInflator(SkInflator* inf) { fInflator = inf; } // sk_sp inflateImage(); - + protected: /** * Allows subclass to check if we are using factories for expansion diff --git a/src/core/SkRegion.cpp b/src/core/SkRegion.cpp index b25633b67c..dd70d1f507 100644 --- a/src/core/SkRegion.cpp +++ b/src/core/SkRegion.cpp @@ -200,7 +200,7 @@ char* SkRegion::toString() { iter.reset(*this); while (!iter.done()) { const SkIRect& r = iter.rect(); - count += snprintf(result+count, max - count, + count += snprintf(result+count, max - count, "(%d,%d,%d,%d)", r.fLeft, r.fTop, r.fRight, r.fBottom); iter.next(); } diff --git a/src/core/SkStroke.cpp b/src/core/SkStroke.cpp index 7e5d4e3939..0852f56bd2 100644 --- a/src/core/SkStroke.cpp +++ b/src/core/SkStroke.cpp @@ -1396,7 +1396,7 @@ void SkStroke::strokePath(const SkPath& src, SkPath* dst) const { // We can always ignore centers for stroke and fill convex line-only paths // TODO: remove the line-only restriction - bool ignoreCenter = fDoFill && (src.getSegmentMasks() == SkPath::kLine_SegmentMask) && + bool ignoreCenter = fDoFill && (src.getSegmentMasks() == SkPath::kLine_SegmentMask) && src.isLastContourClosed() && src.isConvex(); SkPathStroker stroker(src, radius, fMiterLimit, this->getCap(), this->getJoin(), diff --git a/src/core/SkTextBlob.cpp b/src/core/SkTextBlob.cpp index 03ef397dc0..ebd73a91dc 100644 --- a/src/core/SkTextBlob.cpp +++ b/src/core/SkTextBlob.cpp @@ -247,7 +247,7 @@ private: SkTextBlob::GlyphPositioning positioning) { return glyphCount * ScalarsPerGlyph(positioning); } - + uint32_t* textSizePtr() const { // textSize follows the position buffer. SkASSERT(isExtended()); @@ -809,7 +809,7 @@ sk_sp SkTextBlob::MakeFromBuffer(SkReadBuffer& reader) { } } } - + return blobBuilder.make(); } diff --git a/src/core/SkVertices.cpp b/src/core/SkVertices.cpp index 8dadad056b..853bd31ca8 100644 --- a/src/core/SkVertices.cpp +++ b/src/core/SkVertices.cpp @@ -216,6 +216,6 @@ sk_sp SkVertices::Decode(const void* data, size_t length) { reader.read(builder.texCoords(), sizes.fTSize); reader.read(builder.colors(), sizes.fCSize); reader.read(builder.indices(), sizes.fISize); - + return builder.detach(); } diff --git a/src/effects/SkDropShadowImageFilter.cpp b/src/effects/SkDropShadowImageFilter.cpp index f0e4c7f022..7d0d90587e 100644 --- a/src/effects/SkDropShadowImageFilter.cpp +++ b/src/effects/SkDropShadowImageFilter.cpp @@ -20,7 +20,7 @@ sk_sp SkDropShadowImageFilter::Make(SkScalar dx, SkScalar dy, SkColor color, ShadowMode shadowMode, sk_sp input, const CropRect* cropRect) { - return sk_sp(new SkDropShadowImageFilter(dx, dy, sigmaX, sigmaY, + return sk_sp(new SkDropShadowImageFilter(dx, dy, sigmaX, sigmaY, color, shadowMode, std::move(input), cropRect)); diff --git a/src/effects/SkEmbossMaskFilter.h b/src/effects/SkEmbossMaskFilter.h index 395657224c..29b70ad1f9 100644 --- a/src/effects/SkEmbossMaskFilter.h +++ b/src/effects/SkEmbossMaskFilter.h @@ -24,7 +24,7 @@ public: }; static sk_sp Make(SkScalar blurSigma, const Light& light); - + // overrides from SkMaskFilter // This method is not exported to java. SkMask::Format getFormat() const override; diff --git a/src/effects/SkPictureImageFilter.cpp b/src/effects/SkPictureImageFilter.cpp index da3204e132..c335474200 100644 --- a/src/effects/SkPictureImageFilter.cpp +++ b/src/effects/SkPictureImageFilter.cpp @@ -22,7 +22,7 @@ sk_sp SkPictureImageFilter::Make(sk_sp picture) { sk_sp SkPictureImageFilter::Make(sk_sp picture, const SkRect& cropRect) { - return sk_sp(new SkPictureImageFilter(std::move(picture), + return sk_sp(new SkPictureImageFilter(std::move(picture), cropRect, kDeviceSpace_PictureResolution, kLow_SkFilterQuality, @@ -177,7 +177,7 @@ void SkPictureImageFilter::drawPictureAtLocalResolution(SkSpecialImage* source, SkIRect localIBounds = localBounds.roundOut(); sk_sp localImg; - { + { sk_sp localSurface(source->makeSurface(ctx.outputProperties(), localIBounds.size())); if (!localSurface) { diff --git a/src/effects/SkRRectsGaussianEdgeMaskFilter.cpp b/src/effects/SkRRectsGaussianEdgeMaskFilter.cpp index 2f697a3a63..27bf09fd7c 100644 --- a/src/effects/SkRRectsGaussianEdgeMaskFilter.cpp +++ b/src/effects/SkRRectsGaussianEdgeMaskFilter.cpp @@ -415,7 +415,7 @@ private: second.getBounds().centerX(), second.getBounds().centerY()); - pdman.set4f(fSizesUni, + pdman.set4f(fSizesUni, 0.5f * first.rect().width(), 0.5f * first.rect().height(), 0.5f * second.rect().width(), @@ -425,7 +425,7 @@ private: edgeFP.secondMode() == kSimpleCircular_Mode) { // This is a bit of overkill since fX should equal fY for both round rects but it // makes the shader code simpler. - pdman.set4f(fRadiiUni, + pdman.set4f(fRadiiUni, first.getSimpleRadii().fX, first.getSimpleRadii().fY, second.getSimpleRadii().fX, second.getSimpleRadii().fY); } @@ -495,7 +495,7 @@ private: bool onIsEqual(const GrFragmentProcessor& proc) const override { const RRectsGaussianEdgeFP& edgeFP = proc.cast(); return fFirst == edgeFP.fFirst && - fSecond == edgeFP.fSecond && + fSecond == edgeFP.fSecond && fRadius == edgeFP.fRadius; } @@ -568,9 +568,9 @@ void SkRRectsGaussianEdgeMaskFilterImpl::flatten(SkWriteBuffer& buf) const { sk_sp SkRRectsGaussianEdgeMaskFilter::Make(const SkRRect& first, const SkRRect& second, SkScalar radius) { - if ((!first.isRect() && !first.isCircle() && !first.isSimpleCircular()) || + if ((!first.isRect() && !first.isCircle() && !first.isSimpleCircular()) || (!second.isRect() && !second.isCircle() && !second.isSimpleCircular())) { - // we only deal with the shapes where the x & y radii are equal + // we only deal with the shapes where the x & y radii are equal // and the same for all four corners return nullptr; } diff --git a/src/effects/SkTileImageFilter.cpp b/src/effects/SkTileImageFilter.cpp index 050e813a9a..59e6e29fee 100644 --- a/src/effects/SkTileImageFilter.cpp +++ b/src/effects/SkTileImageFilter.cpp @@ -89,7 +89,7 @@ sk_sp SkTileImageFilter::onFilterImage(SkSpecialImage* source, SkPaint paint; paint.setBlendMode(SkBlendMode::kSrc); - input->draw(canvas, + input->draw(canvas, SkIntToScalar(inputOffset.x()), SkIntToScalar(inputOffset.y()), &paint); diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp index 4ad789269c..1337cfa481 100644 --- a/src/effects/SkXfermodeImageFilter.cpp +++ b/src/effects/SkXfermodeImageFilter.cpp @@ -128,7 +128,7 @@ sk_sp SkXfermodeImageFilter_Base::onFilterImage(SkSpecialImage* srcBounds = SkIRect::MakeXYWH(backgroundOffset.x(), backgroundOffset.y(), background->width(), background->height()); } - + srcBounds.join(foregroundBounds); if (srcBounds.isEmpty()) { return nullptr; @@ -145,7 +145,7 @@ sk_sp SkXfermodeImageFilter_Base::onFilterImage(SkSpecialImage* #if SK_SUPPORT_GPU if (source->isTextureBacked()) { return this->filterImageGPU(source, - background, backgroundOffset, + background, backgroundOffset, foreground, foregroundOffset, bounds, ctx.outputProperties()); } diff --git a/src/gpu/GrShaderVar.h b/src/gpu/GrShaderVar.h index 5a379b9d77..29e056c332 100644 --- a/src/gpu/GrShaderVar.h +++ b/src/gpu/GrShaderVar.h @@ -29,7 +29,7 @@ public: }; /** - * Values for array count that have special meaning. We allow 1-sized arrays.git + * Values for array count that have special meaning. We allow 1-sized arrays.git */ enum { kNonArray = 0, // not an array diff --git a/src/gpu/GrSurfaceContextPriv.h b/src/gpu/GrSurfaceContextPriv.h index bd3d2de217..4a45f8f9b8 100644 --- a/src/gpu/GrSurfaceContextPriv.h +++ b/src/gpu/GrSurfaceContextPriv.h @@ -18,7 +18,7 @@ public: GrContext* getContext() { return fSurfaceContext->fContext; } private: - explicit GrSurfaceContextPriv(GrSurfaceContext* surfaceContext) + explicit GrSurfaceContextPriv(GrSurfaceContext* surfaceContext) : fSurfaceContext(surfaceContext) { } diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp index 580031f2fb..1b39363419 100644 --- a/src/gpu/GrSurfaceProxy.cpp +++ b/src/gpu/GrSurfaceProxy.cpp @@ -454,7 +454,7 @@ void GrSurfaceProxyPriv::exactify() { if (fProxy->fTarget) { // The kApprox but already instantiated case. Setting the proxy's width & height to // the instantiated width & height could have side-effects going forward, since we're - // obliterating the area of interest information. This call (exactify) only used + // obliterating the area of interest information. This call (exactify) only used // when converting an SkSpecialImage to an SkImage so the proxy shouldn't be // used for additional draws. fProxy->fWidth = fProxy->fTarget->width(); diff --git a/src/gpu/GrTessellator.h b/src/gpu/GrTessellator.h index a09b7c2e43..4f82ea8b8c 100644 --- a/src/gpu/GrTessellator.h +++ b/src/gpu/GrTessellator.h @@ -46,7 +46,7 @@ struct WindingVertex { int PathToVertices(const SkPath& path, SkScalar tolerance, const SkRect& clipBounds, WindingVertex** verts); -int PathToTriangles(const SkPath& path, SkScalar tolerance, const SkRect& clipBounds, +int PathToTriangles(const SkPath& path, SkScalar tolerance, const SkRect& clipBounds, VertexAllocator*, bool antialias, const GrColor& color, bool canTweakAlphaForCoverage, bool *isLinear); } diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index 94c5f2e184..63fe074d79 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -585,7 +585,7 @@ void GrGLCaps::init(const GrContextOptions& contextOptions, // See crbug.com/755871. This could probably be narrowed to just partial clears as the driver // bugs seems to involve clearing too much and not skipping the clear. - // See crbug.com/768134. This is also needed for full clears and was seen on an nVidia K620 + // See crbug.com/768134. This is also needed for full clears and was seen on an nVidia K620 // but only for D3D11 ANGLE. if (GrGLANGLEBackend::kD3D11 == ctxInfo.angleBackend()) { fUseDrawInsteadOfClear = true; diff --git a/src/gpu/gl/GrGLContext.h b/src/gpu/gl/GrGLContext.h index 977d3606a5..4e3712559c 100644 --- a/src/gpu/gl/GrGLContext.h +++ b/src/gpu/gl/GrGLContext.h @@ -95,7 +95,7 @@ public: ~GrGLContext() override; private: - GrGLContext(const ConstructorArgs& args) + GrGLContext(const ConstructorArgs& args) : INHERITED(args) , fCompiler(nullptr) {} diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index 10dabe4629..159cec721f 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -3304,7 +3304,7 @@ static inline bool can_blit_framebuffer_for_copy_surface( if (dstRT && dstRT->numColorSamples() > 0) { return false; } - } + } if (GrGLCaps::kNoFormatConversion_BlitFramebufferFlag & blitFramebufferFlags) { if (dst->config() != src->config()) { return false; diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp index d5b1a8d1d4..6de545b0c4 100644 --- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp +++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp @@ -226,7 +226,7 @@ void GrGLSLFragmentShaderBuilder::enableCustomOutput() { fCustomColorOutputIndex = fOutputs.count(); fOutputs.push_back().set(kHalf4_GrSLType, DeclaredColorOutputName(), GrShaderVar::kOut_TypeModifier); - fProgramBuilder->finalizeFragmentOutputColor(fOutputs.back()); + fProgramBuilder->finalizeFragmentOutputColor(fOutputs.back()); } } diff --git a/src/gpu/instanced/InstancedRendering.h b/src/gpu/instanced/InstancedRendering.h index e349f6337b..93e3d5884e 100644 --- a/src/gpu/instanced/InstancedRendering.h +++ b/src/gpu/instanced/InstancedRendering.h @@ -35,7 +35,7 @@ class InstanceProcessor; * There is only one OpAllocator which encapsulates the creation of InstancedOps and the pool * of memory used for their Draw objects. * - * The InstancedRendering class tracks a list of InstancedOps that will all be drawn during + * The InstancedRendering class tracks a list of InstancedOps that will all be drawn during * the same flush. There is currently one per opList. The nature of instanced * rendering allows these ops to combine well and render efficiently. * During a flush, it assembles the accumulated draw data into a single vertex and texel diff --git a/src/gpu/mtl/GrMtlCaps.h b/src/gpu/mtl/GrMtlCaps.h index b793159ad5..75bb2e7125 100644 --- a/src/gpu/mtl/GrMtlCaps.h +++ b/src/gpu/mtl/GrMtlCaps.h @@ -60,7 +60,7 @@ public: private: void initFeatureSet(MTLFeatureSet featureSet); - + void initGrCaps(const id device); void initShaderCaps(); void initSampleCount(); diff --git a/src/gpu/ops/GrAAConvexTessellator.cpp b/src/gpu/ops/GrAAConvexTessellator.cpp index aea7ce72ae..6c0125a576 100644 --- a/src/gpu/ops/GrAAConvexTessellator.cpp +++ b/src/gpu/ops/GrAAConvexTessellator.cpp @@ -584,7 +584,7 @@ void GrAAConvexTessellator::createOuterRing(const Ring& previousRing, SkScalar o // For very shallow angles all the corner points could fuse if (!duplicate_pt(miter, this->point(perp1Idx))) { int miterIdx; - miterIdx = this->addPt(miter, -outset, coverage, false, + miterIdx = this->addPt(miter, -outset, coverage, false, kSharp_CurveState); nextRing->addIdx(miterIdx, originalIdx); // The two triangles for the corner diff --git a/src/gpu/ops/GrAAConvexTessellator.h b/src/gpu/ops/GrAAConvexTessellator.h index 2fdde10324..ee91128bfb 100644 --- a/src/gpu/ops/GrAAConvexTessellator.h +++ b/src/gpu/ops/GrAAConvexTessellator.h @@ -143,7 +143,7 @@ private: void makeOriginalRing() { for (int i = 0; i < fPts.count(); ++i) { fPts[i].fOrigEdgeId = fPts[i].fIndex; - } + } } // init should be called after all the indices have been added (via addIdx) diff --git a/src/gpu/ops/GrAtlasTextOp.h b/src/gpu/ops/GrAtlasTextOp.h index 7ae31665f4..0738ce7f20 100644 --- a/src/gpu/ops/GrAtlasTextOp.h +++ b/src/gpu/ops/GrAtlasTextOp.h @@ -172,7 +172,7 @@ private: bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override; static constexpr auto kMaxTextures = 4; - + // TODO just use class params sk_sp setupDfProcessor(const SkMatrix& viewMatrix, SkColor luminanceColor, GrColor color, diff --git a/src/gpu/vk/GrVkDescriptorPool.h b/src/gpu/vk/GrVkDescriptorPool.h index 5327a7de8c..97c27e1eaf 100644 --- a/src/gpu/vk/GrVkDescriptorPool.h +++ b/src/gpu/vk/GrVkDescriptorPool.h @@ -33,7 +33,7 @@ public: #ifdef SK_TRACE_VK_RESOURCES void dumpInfo() const override { - SkDebugf("GrVkDescriptorPool: %d, type %d (%d refs)\n", fDescPool, fType, + SkDebugf("GrVkDescriptorPool: %d, type %d (%d refs)\n", fDescPool, fType, this->getRefCnt()); } #endif diff --git a/src/gpu/vk/GrVkMemory.cpp b/src/gpu/vk/GrVkMemory.cpp index 0496a5463c..a90533e17b 100644 --- a/src/gpu/vk/GrVkMemory.cpp +++ b/src/gpu/vk/GrVkMemory.cpp @@ -483,7 +483,7 @@ GrVkSubHeap::GrVkSubHeap(const GrVkGpu* gpu, uint32_t memoryTypeIndex, uint32_t &fAlloc)); if (VK_SUCCESS != err) { this->reset(); - } + } #ifdef SK_DEBUG else { gHeapUsage[heapIndex] += size; diff --git a/src/gpu/vk/GrVkMemory.h b/src/gpu/vk/GrVkMemory.h index 77267ab48c..a8f3771388 100644 --- a/src/gpu/vk/GrVkMemory.h +++ b/src/gpu/vk/GrVkMemory.h @@ -107,7 +107,7 @@ private: const GrVkGpu* fGpu; #ifdef SK_DEBUG uint32_t fHeapIndex; -#endif +#endif uint32_t fMemoryTypeIndex; VkDeviceMemory fAlloc; diff --git a/src/pathops/SkAddIntersections.cpp b/src/pathops/SkAddIntersections.cpp index b9f2d8dee2..f772cc2b06 100644 --- a/src/pathops/SkAddIntersections.cpp +++ b/src/pathops/SkAddIntersections.cpp @@ -521,7 +521,7 @@ bool AddIntersectTs(SkOpContour* test, SkOpContour* next, SkOpCoincidence* coinc SkOpPtT* nextTAt = iPtIsIntegral ? wn.segment()->addT(ts[!swap][pt], iPt) : wn.segment()->addT(ts[!swap][pt]); if (!testTAt->contains(nextTAt)) { - SkOpPtT* oppPrev = testTAt->oppPrev(nextTAt); // Returns nullptr if pair + SkOpPtT* oppPrev = testTAt->oppPrev(nextTAt); // Returns nullptr if pair if (oppPrev) { // already share a pt-t loop. testTAt->span()->mergeMatches(nextTAt->span()); testTAt->addOpp(nextTAt, oppPrev); diff --git a/src/pathops/SkDLineIntersection.cpp b/src/pathops/SkDLineIntersection.cpp index 082e2987b9..5540c5c165 100644 --- a/src/pathops/SkDLineIntersection.cpp +++ b/src/pathops/SkDLineIntersection.cpp @@ -122,10 +122,10 @@ int SkIntersections::intersect(const SkDLine& a, const SkDLine& b) { computePoints(a, 1); } } -/* Allow tracking that both sets of end points are near each other -- the lines are entirely +/* Allow tracking that both sets of end points are near each other -- the lines are entirely coincident -- even when the end points are not exactly the same. Mark this as a 'wild card' for the end points, so that either point is considered totally - coincident. Then, avoid folding the lines over each other, but allow either end to mate + coincident. Then, avoid folding the lines over each other, but allow either end to mate to the next set of lines. */ if (fAllowNear || !unparallel) { diff --git a/src/pathops/SkOpCubicHull.cpp b/src/pathops/SkOpCubicHull.cpp index 6b17608e84..a733138ad4 100644 --- a/src/pathops/SkOpCubicHull.cpp +++ b/src/pathops/SkOpCubicHull.cpp @@ -97,7 +97,7 @@ int SkDCubic::convexHull(char order[4]) const { order[2] = 1; return 3; } - // one of the control points may be very nearly but not exactly equal -- + // one of the control points may be very nearly but not exactly equal -- double dist1_0 = fPts[1].distanceSquared(fPts[0]); double dist1_3 = fPts[1].distanceSquared(fPts[3]); double dist2_0 = fPts[2].distanceSquared(fPts[0]); diff --git a/src/pathops/SkOpSpan.cpp b/src/pathops/SkOpSpan.cpp index 40d6383c74..28989d9511 100644 --- a/src/pathops/SkOpSpan.cpp +++ b/src/pathops/SkOpSpan.cpp @@ -327,7 +327,7 @@ void SkOpSpanBase::mergeMatches(SkOpSpanBase* opp) { } SkOpSpanBase* innerBase = inner->span(); SkASSERT(innerBase->ptT() == inner); - // when the intersection is first detected, the span base is marked if there are + // when the intersection is first detected, the span base is marked if there are // more than one point in the intersection. if (!zero_or_one(inner->fT)) { innerBase->upCast()->release(test); diff --git a/src/pathops/SkPathOpsCommon.cpp b/src/pathops/SkPathOpsCommon.cpp index 9cdf8124a8..feba8d38a8 100644 --- a/src/pathops/SkPathOpsCommon.cpp +++ b/src/pathops/SkPathOpsCommon.cpp @@ -326,7 +326,7 @@ bool HandleCoincidence(SkOpContourHead* contourList, SkOpCoincidence* coincidenc // adjust the winding value to account for coincident edges if (!pairs->apply(DEBUG_ITER_ONLY_PARAMS(SAFETY_COUNT - safetyHatch))) { return false; - } + } // For each coincident pair that overlaps another, when the receivers (the 1st of the pair) // are different, construct a new pair to resolve their mutual span if (!pairs->findOverlaps(&overlaps DEBUG_ITER_PARAMS(SAFETY_COUNT - safetyHatch))) { diff --git a/src/pathops/SkPathOpsDebug.cpp b/src/pathops/SkPathOpsDebug.cpp index f0a8da3136..b3ca85210b 100644 --- a/src/pathops/SkPathOpsDebug.cpp +++ b/src/pathops/SkPathOpsDebug.cpp @@ -1122,7 +1122,7 @@ void SkOpSegment::debugSetCoinT(int index, SkScalar t) const { fDebugBaseMin = SkTMin(t, fDebugBaseMin); fDebugBaseMax = SkTMax(t, fDebugBaseMax); return; - } + } SkASSERT(fDebugBaseMin >= t || t >= fDebugBaseMax); if (fDebugLastMax < 0 || fDebugLastIndex == index) { fDebugLastIndex = index; @@ -1840,8 +1840,8 @@ void SkOpCoincidence::debugAddOrOverlap(SkPathOpsDebug::GlitchLog* log, } this->debugValidate(); RETURN_FALSE_IF(csDeleted, coinSeg); - RETURN_FALSE_IF(osDeleted, oppSeg); - RETURN_FALSE_IF(ceDeleted, coinSeg); + RETURN_FALSE_IF(osDeleted, oppSeg); + RETURN_FALSE_IF(ceDeleted, coinSeg); RETURN_FALSE_IF(oeDeleted, oppSeg); RETURN_FALSE_IF(!cs || !ce || cs == ce || cs->contains(ce) || !os || !oe || os == oe || os->contains(oe), coinSeg); bool result = true; @@ -2508,7 +2508,7 @@ void SkOpSpanBase::debugMergeMatches(SkPathOpsDebug::GlitchLog* log, const SkOpS } const SkOpSpanBase* innerBase = inner->span(); SkASSERT(innerBase->ptT() == inner); - // when the intersection is first detected, the span base is marked if there are + // when the intersection is first detected, the span base is marked if there are // more than one point in the intersection. // if (!innerBase->hasMultipleHint() && !testBase->hasMultipleHint()) { if (!zero_or_one(inner->fT)) { @@ -2537,7 +2537,7 @@ void SkOpSpanBase::debugMergeMatches(SkPathOpsDebug::GlitchLog* log, const SkOpS SkOPASSERT(0); } #endif - break; + break; // } break; } while ((inner = inner->next()) != innerStop); @@ -2793,13 +2793,13 @@ const SkOpPtT* SkOpPtT::debugOppPrev(const SkOpPtT* opp) const { void SkOpPtT::debugResetCoinT() const { #if DEBUG_COINCIDENCE_ORDER - this->segment()->debugResetCoinT(); + this->segment()->debugResetCoinT(); #endif } void SkOpPtT::debugSetCoinT(int index) const { #if DEBUG_COINCIDENCE_ORDER - this->segment()->debugSetCoinT(index, fT); + this->segment()->debugSetCoinT(index, fT); #endif } diff --git a/src/pathops/SkPathOpsDebug.h b/src/pathops/SkPathOpsDebug.h index 65aedc55df..afdfb32be1 100644 --- a/src/pathops/SkPathOpsDebug.h +++ b/src/pathops/SkPathOpsDebug.h @@ -134,7 +134,7 @@ class SkOpContourHead; extern int gDumpTSectNum; #endif -#if DEBUG_COINCIDENCE || DEBUG_COINCIDENCE_DUMP +#if DEBUG_COINCIDENCE || DEBUG_COINCIDENCE_DUMP #define DEBUG_COIN 1 #else #define DEBUG_COIN 0 diff --git a/src/pathops/SkPathOpsTSect.cpp b/src/pathops/SkPathOpsTSect.cpp index 9bff5af4f0..e096837cec 100644 --- a/src/pathops/SkPathOpsTSect.cpp +++ b/src/pathops/SkPathOpsTSect.cpp @@ -8,54 +8,54 @@ #include "SkPathOpsTSect.h" int SkIntersections::intersect(const SkDQuad& quad1, const SkDQuad& quad2) { - SkTSect sect1(quad1 + SkTSect sect1(quad1 SkDEBUGPARAMS(globalState()) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); - SkTSect sect2(quad2 + SkTSect sect2(quad2 SkDEBUGPARAMS(globalState()) PATH_OPS_DEBUG_T_SECT_PARAMS(2)); SkTSect::BinarySearch(§1, §2, this); return used(); } int SkIntersections::intersect(const SkDConic& conic, const SkDQuad& quad) { - SkTSect sect1(conic + SkTSect sect1(conic SkDEBUGPARAMS(globalState()) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); - SkTSect sect2(quad + SkTSect sect2(quad SkDEBUGPARAMS(globalState()) PATH_OPS_DEBUG_T_SECT_PARAMS(2)); SkTSect::BinarySearch(§1, §2, this); return used(); } int SkIntersections::intersect(const SkDConic& conic1, const SkDConic& conic2) { - SkTSect sect1(conic1 + SkTSect sect1(conic1 SkDEBUGPARAMS(globalState()) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); - SkTSect sect2(conic2 + SkTSect sect2(conic2 SkDEBUGPARAMS(globalState()) PATH_OPS_DEBUG_T_SECT_PARAMS(2)); SkTSect::BinarySearch(§1, §2, this); return used(); } int SkIntersections::intersect(const SkDCubic& cubic, const SkDQuad& quad) { - SkTSect sect1(cubic + SkTSect sect1(cubic SkDEBUGPARAMS(globalState()) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); - SkTSect sect2(quad + SkTSect sect2(quad SkDEBUGPARAMS(globalState()) PATH_OPS_DEBUG_T_SECT_PARAMS(2)); SkTSect::BinarySearch(§1, §2, this); return used(); } int SkIntersections::intersect(const SkDCubic& cubic, const SkDConic& conic) { - SkTSect sect1(cubic + SkTSect sect1(cubic SkDEBUGPARAMS(globalState()) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); - SkTSect sect2(conic + SkTSect sect2(conic SkDEBUGPARAMS(globalState()) PATH_OPS_DEBUG_T_SECT_PARAMS(2)); SkTSect::BinarySearch(§1, §2, this); return used(); } int SkIntersections::intersect(const SkDCubic& cubic1, const SkDCubic& cubic2) { - SkTSect sect1(cubic1 + SkTSect sect1(cubic1 SkDEBUGPARAMS(globalState()) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); - SkTSect sect2(cubic2 + SkTSect sect2(cubic2 SkDEBUGPARAMS(globalState()) PATH_OPS_DEBUG_T_SECT_PARAMS(2)); SkTSect::BinarySearch(§1, §2, this); return used(); diff --git a/src/pathops/SkPathWriter.cpp b/src/pathops/SkPathWriter.cpp index 9893a502ca..7291002593 100644 --- a/src/pathops/SkPathWriter.cpp +++ b/src/pathops/SkPathWriter.cpp @@ -237,7 +237,7 @@ void SkPathWriter::assemble() { double dist = dx * dx + dy * dy; distLookup.push_back(rRow + iIndex); distances.push_back(dist); // oStart distance from iStart - sortedDist.push_back(dIndex++); + sortedDist.push_back(dIndex++); } rRow += endCount; } diff --git a/src/pathops/SkPathWriter.h b/src/pathops/SkPathWriter.h index 5dd1bf6f60..6534b840c1 100644 --- a/src/pathops/SkPathWriter.h +++ b/src/pathops/SkPathWriter.h @@ -43,7 +43,7 @@ private: bool someAssemblyRequired(); void update(const SkOpPtT* pt); - SkPath fCurrent; // contour under construction + SkPath fCurrent; // contour under construction SkTArray fPartials; // contours with mismatched starts and ends SkTDArray fEndPtTs; // possible pt values for partial starts and ends SkPath* fPathPtr; // closed contours are written here diff --git a/src/pipe/SkPipeCanvas.h b/src/pipe/SkPipeCanvas.h index 5604ba787a..dec346f367 100644 --- a/src/pipe/SkPipeCanvas.h +++ b/src/pipe/SkPipeCanvas.h @@ -154,7 +154,7 @@ protected: const SkPaint*) override; void onDrawBitmapLattice(const SkBitmap&, const Lattice& lattice, const SkRect& dst, const SkPaint*) override; - + private: SkPipeDeduper* fDeduper; SkWStream* fStream; diff --git a/src/pipe/SkPipeFormat.h b/src/pipe/SkPipeFormat.h index a6521279d0..3d4904f0d2 100644 --- a/src/pipe/SkPipeFormat.h +++ b/src/pipe/SkPipeFormat.h @@ -17,7 +17,7 @@ enum class SkPipeVerb : uint8_t { kSaveLayer, kRestore, // extra == 0 kConcat, // extra == SkMatrix::MaskType - + kClipRect, // extra == (SkRegion::Op << 1) | isAntiAlias:1 kClipRRect, // extra == (SkRegion::Op << 1) | isAntiAlias:1 kClipPath, // extra == (SkRegion::Op << 1) | isAntiAlias:1 @@ -40,14 +40,14 @@ enum class SkPipeVerb : uint8_t { kDrawPath, // extra == 0 kDrawOval, // extra == 0 kDrawRRect, // extra == 0 - + kDrawImage, // extra == has_paint:1 kDrawImageRect, // extra == constraint | has_src_rect | has_paint kDrawImageNine, // extra == has_paint:1 kDrawImageLattice, // extra == x_count:8 | y_count:8 | has_paint:1 - + kDrawVertices, - + kDrawPicture, // extra == picture_index kDrawAnnotation, // extra == (key_len_plus_1:23 << 1) else next 32 | has_data:1 diff --git a/src/pipe/SkPipeReader.cpp b/src/pipe/SkPipeReader.cpp index 7854a78f4b..593c8b3ce9 100644 --- a/src/pipe/SkPipeReader.cpp +++ b/src/pipe/SkPipeReader.cpp @@ -37,7 +37,7 @@ public: , fTFDeserializer(tfd) , fIMDeserializer(imd) {} - + SkImage* getImage(int index) override { return index ? fImages->get(index - 1) : nullptr; } @@ -79,11 +79,11 @@ public: void setTypefaceDeserializer(SkTypefaceDeserializer* tfd) { fTFDeserializer = tfd; } - + void setImageDeserializer(SkImageDeserializer* imd) { fIMDeserializer = imd; } - + sk_sp makeTypeface(const void* data, size_t size); sk_sp makeImage(const sk_sp&); @@ -216,7 +216,7 @@ public: } return factory; } - + void readPaint(SkPaint* paint) override { *paint = read_paint(*this); } @@ -767,12 +767,12 @@ const HandlerRec gPipeHandlers[] = { HANDLER(saveLayer), HANDLER(restore), HANDLER(concat), - + HANDLER(clipRect), HANDLER(clipRRect), HANDLER(clipPath), HANDLER(clipRegion), - + HANDLER(drawArc), HANDLER(drawAtlas), HANDLER(drawDRRect), @@ -790,14 +790,14 @@ const HandlerRec gPipeHandlers[] = { HANDLER(drawPath), HANDLER(drawOval), HANDLER(drawRRect), - + HANDLER(drawImage), HANDLER(drawImageRect), HANDLER(drawImageNine), HANDLER(drawImageLattice), - + HANDLER(drawVertices), - + HANDLER(drawPicture), HANDLER(drawAnnotation), diff --git a/src/shaders/SkPerlinNoiseShader.cpp b/src/shaders/SkPerlinNoiseShader.cpp index b1ef1f0a6b..6a59e8972f 100644 --- a/src/shaders/SkPerlinNoiseShader.cpp +++ b/src/shaders/SkPerlinNoiseShader.cpp @@ -489,7 +489,7 @@ SkScalar SkPerlinNoiseShaderImpl::PerlinNoiseShaderContext::noise2D( if (sx < 0 || sy < 0 || sx > 1 || sy > 1) { return 0; // Check for pathological inputs. } - + // This is taken 1:1 from SVG spec: http://www.w3.org/TR/SVG11/filters.html#feTurbulenceElement SkPoint fractionValue = SkPoint::Make(noiseX.noisePositionFractionValue, noiseY.noisePositionFractionValue); // Offset (0,0) diff --git a/src/shaders/gradients/SkRadialGradient.h b/src/shaders/gradients/SkRadialGradient.h index 6a6dadfbc4..1f6441b5a4 100644 --- a/src/shaders/gradients/SkRadialGradient.h +++ b/src/shaders/gradients/SkRadialGradient.h @@ -26,7 +26,7 @@ protected: SkRadialGradient(SkReadBuffer& buffer); void flatten(SkWriteBuffer& buffer) const override; sk_sp onMakeColorSpace(SkColorSpaceXformer* xformer) const override; - + void appendGradientStages(SkArenaAlloc* alloc, SkRasterPipeline* tPipeline, SkRasterPipeline* postPipeline) const override; diff --git a/src/shaders/gradients/SkTwoPointConicalGradient_gpu.cpp b/src/shaders/gradients/SkTwoPointConicalGradient_gpu.cpp index a08addbff9..5743d24b91 100644 --- a/src/shaders/gradients/SkTwoPointConicalGradient_gpu.cpp +++ b/src/shaders/gradients/SkTwoPointConicalGradient_gpu.cpp @@ -641,7 +641,7 @@ private: typedef GrGradientEffect INHERITED; }; -class FocalInside2PtConicalEffect::GLSLFocalInside2PtConicalProcessor +class FocalInside2PtConicalEffect::GLSLFocalInside2PtConicalProcessor : public GrGradientEffect::GLSLProcessor { public: GLSLFocalInside2PtConicalProcessor(const GrProcessor&); diff --git a/src/sksl/GLSL.std.450.h b/src/sksl/GLSL.std.450.h index 54cc00e9a8..943fd8650f 100644 --- a/src/sksl/GLSL.std.450.h +++ b/src/sksl/GLSL.std.450.h @@ -13,7 +13,7 @@ ** ** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS ** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ** ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/src/sksl/spirv.h b/src/sksl/spirv.h index e4f5b5beeb..22821ed862 100644 --- a/src/sksl/spirv.h +++ b/src/sksl/spirv.h @@ -1,20 +1,20 @@ /* ** Copyright (c) 2014-2016 The Khronos Group Inc. -** +** ** Permission is hereby granted, free of charge, to any person obtaining a copy ** of this software and/or associated documentation files (the "Materials"), ** to deal in the Materials without restriction, including without limitation ** the rights to use, copy, modify, merge, publish, distribute, sublicense, ** and/or sell copies of the Materials, and to permit persons to whom the ** Materials are furnished to do so, subject to the following conditions: -** +** ** The above copyright notice and this permission notice shall be included in ** all copies or substantial portions of the Materials. -** +** ** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS ** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -** +** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +** ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL @@ -32,13 +32,13 @@ /* ** Enumeration tokens for SPIR-V, in various styles: ** C, C++, C++11, JSON, Lua, Python -** +** ** - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL ** - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL ** - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL ** - Lua will use tables, e.g.: spv.SourceLanguage.GLSL ** - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -** +** ** Some tokens act like mask values, which can be OR'd together, ** while others are mutually exclusive. The mask-like ones have ** "Mask" in their name, and a parallel enum that has the shift diff --git a/src/views/mac/SkTextFieldCell.m b/src/views/mac/SkTextFieldCell.m index c5efc46406..fbfed05f7f 100644 --- a/src/views/mac/SkTextFieldCell.m +++ b/src/views/mac/SkTextFieldCell.m @@ -5,14 +5,14 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ - + #import "SkTextFieldCell.h" @implementation SkTextFieldCell - (NSRect)drawingRectForBounds:(NSRect)theRect { NSRect newRect = [super drawingRectForBounds:theRect]; if (selectingOrEditing == NO) { NSSize textSize = [self cellSizeForBounds:theRect]; - float heightDelta = newRect.size.height - textSize.height; + float heightDelta = newRect.size.height - textSize.height; if (heightDelta > 0) { newRect.size.height -= heightDelta; newRect.origin.y += (heightDelta / 2); @@ -21,34 +21,34 @@ return newRect; } -- (void)selectWithFrame:(NSRect)aRect - inView:(NSView *)controlView - editor:(NSText *)textObj - delegate:(id)anObject - start:(NSInteger)selStart +- (void)selectWithFrame:(NSRect)aRect + inView:(NSView *)controlView + editor:(NSText *)textObj + delegate:(id)anObject + start:(NSInteger)selStart length:(NSInteger)selLength { aRect = [self drawingRectForBounds:aRect]; - selectingOrEditing = YES; - [super selectWithFrame:aRect - inView:controlView - editor:textObj - delegate:anObject - start:selStart + selectingOrEditing = YES; + [super selectWithFrame:aRect + inView:controlView + editor:textObj + delegate:anObject + start:selStart length:selLength]; selectingOrEditing = NO; } -- (void)editWithFrame:(NSRect)aRect - inView:(NSView *)controlView - editor:(NSText *)textObj - delegate:(id)anObject - event:(NSEvent *)theEvent { +- (void)editWithFrame:(NSRect)aRect + inView:(NSView *)controlView + editor:(NSText *)textObj + delegate:(id)anObject + event:(NSEvent *)theEvent { aRect = [self drawingRectForBounds:aRect]; selectingOrEditing = YES; - [super editWithFrame:aRect - inView:controlView - editor:textObj - delegate:anObject + [super editWithFrame:aRect + inView:controlView + editor:textObj + delegate:anObject event:theEvent]; selectingOrEditing = NO; } diff --git a/src/xml/SkXMLWriter.cpp b/src/xml/SkXMLWriter.cpp index 3a2c3d40c9..67dcf59d1d 100644 --- a/src/xml/SkXMLWriter.cpp +++ b/src/xml/SkXMLWriter.cpp @@ -47,9 +47,9 @@ void SkXMLWriter::addText(const char text[], size_t length) { if (fElems.isEmpty()) { return; } - + this->onAddText(text, length); - + fElems.top()->fHasText = true; } diff --git a/tests/BlurTest.cpp b/tests/BlurTest.cpp index d287642c0a..ba63f01cf4 100644 --- a/tests/BlurTest.cpp +++ b/tests/BlurTest.cpp @@ -534,7 +534,7 @@ DEF_TEST(BlurredRRectNinePatchComputation, reporter) { kBlurRad, kBlurRad, &rrectToDraw, &size, rectXs, rectYs, texXs, texYs, - &numX, &numY, &skipMask); + &numX, &numY, &skipMask); REPORTER_ASSERT(reporter, !ninePatchable); } @@ -591,8 +591,8 @@ DEF_TEST(BlurredRRectNinePatchComputation, reporter) { SkScalar testLocs[] = { -18.0f, -9.0f, 1.0f, - 9.0f, 18.0f, - 29.0f, + 9.0f, 18.0f, + 29.0f, 39.0f, 49.0f, 91.0f, 109.0f, 118.0f, @@ -615,7 +615,7 @@ DEF_TEST(BlurredRRectNinePatchComputation, reporter) { kBlurRad, kBlurRad, &rrectToDraw, &size, rectXs, rectYs, texXs, texYs, - &numX, &numY, &skipMask); + &numX, &numY, &skipMask); static const SkScalar kAns = 12.0f * kBlurRad + 2.0f * kCornerRad + 1.0f; REPORTER_ASSERT(reporter, ninePatchable); diff --git a/tests/DiscardableMemoryTest.cpp b/tests/DiscardableMemoryTest.cpp index 818fbea2e3..2b09533b0c 100644 --- a/tests/DiscardableMemoryTest.cpp +++ b/tests/DiscardableMemoryTest.cpp @@ -57,4 +57,4 @@ DEF_TEST(DiscardableMemory_nonglobal, reporter) { std::unique_ptr dm(pool->create(kTestStringLength)); test_dm(reporter, dm.get(), true); } - + diff --git a/tests/MatrixTest.cpp b/tests/MatrixTest.cpp index da2ae35cd7..6f7a14fdc7 100644 --- a/tests/MatrixTest.cpp +++ b/tests/MatrixTest.cpp @@ -968,7 +968,7 @@ DEF_TEST(Matrix_Concat, r) { // Test that all variants of maprect are correct. DEF_TEST(Matrix_maprects, r) { const SkScalar scale = 1000; - + SkMatrix mat; mat.setScale(2, 3); mat.postTranslate(1, 4); @@ -980,7 +980,7 @@ DEF_TEST(Matrix_maprects, r) { rand.nextSScalar1() * scale, rand.nextSScalar1() * scale); SkRect dst[3]; - + mat.mapPoints((SkPoint*)&dst[0].fLeft, (SkPoint*)&src.fLeft, 2); dst[0].sort(); mat.mapRect(&dst[1], src); diff --git a/tests/PathOpsCubicIntersectionTest.cpp b/tests/PathOpsCubicIntersectionTest.cpp index 6eab71d4fb..7871fde931 100644 --- a/tests/PathOpsCubicIntersectionTest.cpp +++ b/tests/PathOpsCubicIntersectionTest.cpp @@ -170,7 +170,7 @@ const int testSetCount = (int) SK_ARRAY_COUNT(testSet); static const CubicPts newTestSet[] = { { { { 130.0427549999999997, 11417.41309999999976 },{ 130.2331240000000037, 11418.3192999999992 },{ 131.0370790000000056, 11419 },{ 132, 11419 } } }, { { { 132, 11419 },{ 130.8954319999999996, 11419 },{ 130, 11418.10449999999946 },{ 130, 11417 } } }, - + {{{1,3}, {-1.0564518,1.79032254}, {1.45265341,0.229448318}, {1.45381773,0.22913377}}}, {{{1.45381773,0.22913377}, {1.45425761,0.229014933}, {1.0967741,0.451612949}, {0,1}}}, diff --git a/tests/PathOpsSimplifyTest.cpp b/tests/PathOpsSimplifyTest.cpp index 14090aeb40..75c139afe0 100644 --- a/tests/PathOpsSimplifyTest.cpp +++ b/tests/PathOpsSimplifyTest.cpp @@ -6902,19 +6902,19 @@ testSimplify(reporter, path, filename); static void joel_8(skiatest::Reporter* reporter, const char* filename) { SkPath path; -path.moveTo(SkBits2Float(0x42d97520), SkBits2Float(0x410ac429)); // 108.729f, 8.67289f -path.cubicTo(SkBits2Float(0x42d97520), SkBits2Float(0x410ac429), SkBits2Float(0x42e9a9ce), SkBits2Float(0x41834e87), SkBits2Float(0x42e99c8c), SkBits2Float(0x41c5c960)); // 108.729f, 8.67289f, 116.832f, 16.4133f, 116.806f, 24.7233f -path.cubicTo(SkBits2Float(0x42e98f49), SkBits2Float(0x4204221c), SkBits2Float(0x42d97520), SkBits2Float(0x4223825f), SkBits2Float(0x42d97520), SkBits2Float(0x4223825f)); // 116.78f, 33.0333f, 108.729f, 40.8773f, 108.729f, 40.8773f -path.cubicTo(SkBits2Float(0x42d97520), SkBits2Float(0x4223825f), SkBits2Float(0x42dbbc54), SkBits2Float(0x42099f18), SkBits2Float(0x42d1cb74), SkBits2Float(0x41f77dc0)); // 108.729f, 40.8773f, 109.868f, 34.4054f, 104.897f, 30.9364f -path.cubicTo(SkBits2Float(0x42c7da94), SkBits2Float(0x41dbbd4f), SkBits2Float(0x42b1b1a1), SkBits2Float(0x41d802fb), SkBits2Float(0x42b1b1a1), SkBits2Float(0x41d802fb)); // 99.9269f, 27.4674f, 88.8469f, 27.0015f, 88.8469f, 27.0015f -path.cubicTo(SkBits2Float(0x42a75637), SkBits2Float(0x41d6909f), SkBits2Float(0x4296c543), SkBits2Float(0x41f1b139), SkBits2Float(0x4296c543), SkBits2Float(0x41f1b139)); // 83.6684f, 26.8206f, 75.3853f, 30.2115f, 75.3853f, 30.2115f -path.lineTo(SkBits2Float(0x42824475), SkBits2Float(0x41c69d70)); // 65.1337f, 24.8269f -path.lineTo(SkBits2Float(0x4296c543), SkBits2Float(0x419b89a8)); // 75.3853f, 19.4422f -path.cubicTo(SkBits2Float(0x4296c543), SkBits2Float(0x419b89a8), SkBits2Float(0x42a6b798), SkBits2Float(0x41b89815), SkBits2Float(0x42b1b1a1), SkBits2Float(0x41b95c48)); // 75.3853f, 19.4422f, 83.3586f, 23.0743f, 88.8469f, 23.1701f -path.cubicTo(SkBits2Float(0x42b1b1a1), SkBits2Float(0x41b95c48), SkBits2Float(0x42c80258), SkBits2Float(0x41b03f7a), SkBits2Float(0x42d1cb74), SkBits2Float(0x419340ee)); // 88.8469f, 23.1701f, 100.005f, 22.031f, 104.897f, 18.4067f -path.cubicTo(SkBits2Float(0x42db9490), SkBits2Float(0x416c84c2), SkBits2Float(0x42d97520), SkBits2Float(0x410ac42a), SkBits2Float(0x42d97520), SkBits2Float(0x410ac42a)); // 109.79f, 14.7824f, 108.729f, 8.67289f, 108.729f, 8.67289f -path.lineTo(SkBits2Float(0x42d97520), SkBits2Float(0x410ac429)); // 108.729f, 8.67289f -path.close(); +path.moveTo(SkBits2Float(0x42d97520), SkBits2Float(0x410ac429)); // 108.729f, 8.67289f +path.cubicTo(SkBits2Float(0x42d97520), SkBits2Float(0x410ac429), SkBits2Float(0x42e9a9ce), SkBits2Float(0x41834e87), SkBits2Float(0x42e99c8c), SkBits2Float(0x41c5c960)); // 108.729f, 8.67289f, 116.832f, 16.4133f, 116.806f, 24.7233f +path.cubicTo(SkBits2Float(0x42e98f49), SkBits2Float(0x4204221c), SkBits2Float(0x42d97520), SkBits2Float(0x4223825f), SkBits2Float(0x42d97520), SkBits2Float(0x4223825f)); // 116.78f, 33.0333f, 108.729f, 40.8773f, 108.729f, 40.8773f +path.cubicTo(SkBits2Float(0x42d97520), SkBits2Float(0x4223825f), SkBits2Float(0x42dbbc54), SkBits2Float(0x42099f18), SkBits2Float(0x42d1cb74), SkBits2Float(0x41f77dc0)); // 108.729f, 40.8773f, 109.868f, 34.4054f, 104.897f, 30.9364f +path.cubicTo(SkBits2Float(0x42c7da94), SkBits2Float(0x41dbbd4f), SkBits2Float(0x42b1b1a1), SkBits2Float(0x41d802fb), SkBits2Float(0x42b1b1a1), SkBits2Float(0x41d802fb)); // 99.9269f, 27.4674f, 88.8469f, 27.0015f, 88.8469f, 27.0015f +path.cubicTo(SkBits2Float(0x42a75637), SkBits2Float(0x41d6909f), SkBits2Float(0x4296c543), SkBits2Float(0x41f1b139), SkBits2Float(0x4296c543), SkBits2Float(0x41f1b139)); // 83.6684f, 26.8206f, 75.3853f, 30.2115f, 75.3853f, 30.2115f +path.lineTo(SkBits2Float(0x42824475), SkBits2Float(0x41c69d70)); // 65.1337f, 24.8269f +path.lineTo(SkBits2Float(0x4296c543), SkBits2Float(0x419b89a8)); // 75.3853f, 19.4422f +path.cubicTo(SkBits2Float(0x4296c543), SkBits2Float(0x419b89a8), SkBits2Float(0x42a6b798), SkBits2Float(0x41b89815), SkBits2Float(0x42b1b1a1), SkBits2Float(0x41b95c48)); // 75.3853f, 19.4422f, 83.3586f, 23.0743f, 88.8469f, 23.1701f +path.cubicTo(SkBits2Float(0x42b1b1a1), SkBits2Float(0x41b95c48), SkBits2Float(0x42c80258), SkBits2Float(0x41b03f7a), SkBits2Float(0x42d1cb74), SkBits2Float(0x419340ee)); // 88.8469f, 23.1701f, 100.005f, 22.031f, 104.897f, 18.4067f +path.cubicTo(SkBits2Float(0x42db9490), SkBits2Float(0x416c84c2), SkBits2Float(0x42d97520), SkBits2Float(0x410ac42a), SkBits2Float(0x42d97520), SkBits2Float(0x410ac42a)); // 109.79f, 14.7824f, 108.729f, 8.67289f, 108.729f, 8.67289f +path.lineTo(SkBits2Float(0x42d97520), SkBits2Float(0x410ac429)); // 108.729f, 8.67289f +path.close(); testSimplify(reporter, path, filename); } diff --git a/tests/PathOpsTigerTest.cpp b/tests/PathOpsTigerTest.cpp index db1b27db44..e8b21af74f 100644 --- a/tests/PathOpsTigerTest.cpp +++ b/tests/PathOpsTigerTest.cpp @@ -252,7 +252,7 @@ static void tiger_threaded(skiatest::Reporter* reporter, const char* filename) { testlines |= 1LL << bit; } *testRunner.fRunnables.append() = - new PathOpsThreadedRunnable(&testTiger, + new PathOpsThreadedRunnable(&testTiger, (int) (unsigned) (testlines & 0xFFFFFFFF), (int) (unsigned) (testlines >> 32), ab, 0, &testRunner); diff --git a/tests/RenderTargetContextTest.cpp b/tests/RenderTargetContextTest.cpp index 311643e919..07c6fe16ed 100644 --- a/tests/RenderTargetContextTest.cpp +++ b/tests/RenderTargetContextTest.cpp @@ -71,7 +71,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(RenderTargetContextTest, reporter, ctxInfo) { } // TODO: in a future world we should be able to add a test that the majority of - // GrRenderTargetContext calls do not force the instantiation of a deferred + // GrRenderTargetContext calls do not force the instantiation of a deferred // GrRenderTargetContext } #endif diff --git a/tools/add_codereview_message.py b/tools/add_codereview_message.py index 296a894062..ea4afd845e 100755 --- a/tools/add_codereview_message.py +++ b/tools/add_codereview_message.py @@ -39,10 +39,10 @@ def add_codereview_message(issue, message): this url, or this could simply be the issue number. message: (string) message to add. """ - # Passing None for the email and password will result in a prompt or + # Passing None for the email and auth_config will result in a prompt or # reuse of existing cached credentials. - my_rietveld = rietveld.Rietveld(RIETVELD_URL, email=None, password=None) - + my_rietveld = rietveld.Rietveld(RIETVELD_URL, email=None, auth_config=None) + my_rietveld.add_comment(issue, message) diff --git a/tools/bookmaker/bookmaker.cpp b/tools/bookmaker/bookmaker.cpp index 4d0c2d9171..33feda5a35 100644 --- a/tools/bookmaker/bookmaker.cpp +++ b/tools/bookmaker/bookmaker.cpp @@ -67,7 +67,7 @@ static size_t count_indent(const string& text, size_t test, size_t end) { return test - result; } -static void add_code(const string& text, int pos, int end, +static void add_code(const string& text, int pos, int end, size_t outIndent, size_t textIndent, string& example) { do { // fix this to move whole paragraph in, out, but preserve doc indent @@ -86,7 +86,7 @@ static void add_code(const string& text, int pos, int end, pos += nextIndent; while ((size_t) pos < len) { example += '"' == text[pos] ? "\\\"" : - '\\' == text[pos] ? "\\\\" : + '\\' == text[pos] ? "\\\\" : text.substr(pos, 1); ++pos; } @@ -121,14 +121,14 @@ void Definition::setCanonicalFiddle() { opPos += sizeof(operatorStr) - 1; if ('!' == fName[opPos]) { SkASSERT('=' == fName[opPos + 1]); - result += "not_equal_operator"; + result += "not_equal_operator"; } else if ('=' == fName[opPos]) { if ('(' == fName[opPos + 1]) { - result += isMove ? "move_" : "copy_"; - result += "assignment_operator"; + result += isMove ? "move_" : "copy_"; + result += "assignment_operator"; } else { SkASSERT('=' == fName[opPos + 1]); - result += "equal_operator"; + result += "equal_operator"; } } else if ('[' == fName[opPos]) { result += "subscript_operator"; @@ -160,7 +160,7 @@ void Definition::setCanonicalFiddle() { } while (true); if (base == methodName) { fMethodType = Definition::MethodType::kConstructor; - result += "empty_constructor"; + result += "empty_constructor"; } else { result += fName.substr(doubleColons, fName.length() - doubleColons - 2); } @@ -171,7 +171,7 @@ void Definition::setCanonicalFiddle() { } else { size_t comma = fName.find(',', doubleColons); if (string::npos == comma) { - result += isMove ? "move_" : "copy_"; + result += isMove ? "move_" : "copy_"; } fMethodType = Definition::MethodType::kConstructor; // name them by their param types, @@ -413,7 +413,7 @@ bool Definition::checkMethod() const { return methodParser.reportError("multiple #Param with same name"); } foundParam = true; - + } if (!foundParam && !foundException) { return methodParser.reportError("no #Param found"); @@ -688,7 +688,7 @@ string Definition::methodName() const { return fName.substr(start, end - start); } -bool Definition::nextMethodParam(TextParser* methodParser, const char** nextEndPtr, +bool Definition::nextMethodParam(TextParser* methodParser, const char** nextEndPtr, string* paramName) const { int parenCount = 0; TextParser::Save saveState(methodParser); @@ -804,7 +804,7 @@ bool Definition::paramsMatch(const string& match, const string& name) const { } def.skipWhiteSpace(); m.skipWhiteSpace(); - } + } return !def.eof() && ')' == def.peek() && !m.eof() && ')' == m.peek(); } @@ -866,7 +866,7 @@ const Definition* RootDefinition::find(const string& ref, AllowParens allowParen return result; } -/* +/* class contains named struct, enum, enum-member, method, topic, subtopic everything contained by class is uniquely named contained names may be reused by other classes @@ -948,8 +948,8 @@ bool BmhParser::addDefinition(const char* defStart, bool hasEnd, MarkType markTy && fMaps[(int) markType].fExemplary != Exemplary::kOptional) { if (string::npos == fFileName.find("undocumented") && !hasExcluder) { - hasExample == Exemplary::kNo ? - this->reportWarning("missing example") : + hasExample == Exemplary::kNo ? + this->reportWarning("missing example") : this->reportWarning("unexpected example"); } @@ -1005,7 +1005,7 @@ bool BmhParser::addDefinition(const char* defStart, bool hasEnd, MarkType markTy definition->fContentStart = fChar; definition->fName = typeNameBuilder[0]; Definition* parent = fParent; - while (parent && MarkType::kTopic != parent->fMarkType + while (parent && MarkType::kTopic != parent->fMarkType && MarkType::kSubtopic != parent->fMarkType) { parent = parent->fParent; } @@ -1158,7 +1158,7 @@ bool BmhParser::addDefinition(const char* defStart, bool hasEnd, MarkType markTy break; // always treated as one-liners (can't detect misuse easily) case MarkType::kAlias: - case MarkType::kAnchor: + case MarkType::kAnchor: case MarkType::kDefine: case MarkType::kError: case MarkType::kFile: @@ -1207,7 +1207,7 @@ bool BmhParser::addDefinition(const char* defStart, bool hasEnd, MarkType markTy return this->reportError("duplicate alias"); } fAliasMap[alias] = definition; - } + } break; case MarkType::kExternal: (void) this->collectExternals(); // FIXME: detect errors in external defs? @@ -1459,7 +1459,7 @@ bool BmhParser::endTableColumn(const char* end, const char* terminator) { return true; } -// FIXME: some examples may produce different output on different platforms +// FIXME: some examples may produce different output on different platforms // if the text output can be different, think of how to author that bool BmhParser::findDefinitions() { @@ -1772,7 +1772,7 @@ string BmhParser::methodName() { isConstructor = true; } builder = parent->fName + "::"; - } + } if (isConstructor || expectOperator) { paren = this->strnchr(')', end) + 1; } @@ -1838,7 +1838,7 @@ bool BmhParser::popParentStack(Definition* definition) { } TextParser::TextParser(const Definition* definition) : - TextParser(definition->fFileName, definition->fContentStart, definition->fContentEnd, + TextParser(definition->fFileName, definition->fContentStart, definition->fContentEnd, definition->fLineCount) { } @@ -1997,7 +1997,7 @@ vector BmhParser::typeName(MarkType markType, bool* checkEnd) { this->skipNoName(); break; case MarkType::kAlias: - case MarkType::kAnchor: + case MarkType::kAnchor: case MarkType::kBug: // fixme: expect number case MarkType::kDefine: case MarkType::kDefinedBy: @@ -2365,7 +2365,7 @@ int main(int argc, char** const argv) { topics += count_children(*topic.second, MarkType::kSubtopic); topics += count_children(*topic.second, MarkType::kTopic); } - SkDebugf("topics=%d classes=%d methods=%d examples=%d\n", + SkDebugf("topics=%d classes=%d methods=%d examples=%d\n", bmhParser.fTopicMap.size(), bmhParser.fClassMap.size(), methods, examples); } diff --git a/tools/bookmaker/bookmaker.h b/tools/bookmaker/bookmaker.h index 4cb9fea1c7..3954c6eaad 100644 --- a/tools/bookmaker/bookmaker.h +++ b/tools/bookmaker/bookmaker.h @@ -11,7 +11,7 @@ #include "SkCommandLineFlags.h" #include "SkData.h" -#include +#include #include #include #include @@ -322,14 +322,14 @@ public: bool match(TextParser* ); - char next() { + char next() { SkASSERT(fChar < fEnd); char result = *fChar++; if ('\n' == result) { ++fLineCount; fLine = fChar; } - return result; + return result; } char peek() const { SkASSERT(fChar < fEnd); return *fChar; } @@ -475,14 +475,14 @@ public: return this->eof() || ' ' >= fChar[0]; } - bool skipSpace() { - while (' ' == this->peek()) { + bool skipSpace() { + while (' ' == this->peek()) { (void) this->next(); if (fChar >= fEnd) { return false; } - } - return true; + } + return true; } bool skipWord(const char* word) { @@ -500,19 +500,19 @@ public: return true; } - bool skipWhiteSpace() { - while (' ' >= this->peek()) { + bool skipWhiteSpace() { + while (' ' >= this->peek()) { (void) this->next(); if (fChar >= fEnd) { return false; } - } - return true; + } + return true; } bool startsWith(const char* str) const { size_t len = strlen(str); - ptrdiff_t lineLen = fEnd - fChar; + ptrdiff_t lineLen = fEnd - fChar; return len <= (size_t) lineLen && 0 == strncmp(str, fChar, len); } @@ -688,7 +688,7 @@ public: Definition() {} - Definition(const char* start, const char* end, int line, Definition* parent) + Definition(const char* start, const char* end, int line, Definition* parent) : fStart(start) , fContentStart(start) , fContentEnd(end) @@ -702,30 +702,30 @@ public: this->setParentIndex(); } - Definition(MarkType markType, const char* start, int line, Definition* parent) + Definition(MarkType markType, const char* start, int line, Definition* parent) : Definition(markType, start, nullptr, line, parent) { } - Definition(MarkType markType, const char* start, const char* end, int line, Definition* parent) + Definition(MarkType markType, const char* start, const char* end, int line, Definition* parent) : Definition(start, end, line, parent) { fMarkType = markType; - fType = Type::kMark; + fType = Type::kMark; } - Definition(Bracket bracket, const char* start, int lineCount, Definition* parent) + Definition(Bracket bracket, const char* start, int lineCount, Definition* parent) : Definition(start, nullptr, lineCount, parent) { fBracket = bracket; fType = Type::kBracket; } - Definition(KeyWord keyWord, const char* start, const char* end, int lineCount, - Definition* parent) + Definition(KeyWord keyWord, const char* start, const char* end, int lineCount, + Definition* parent) : Definition(start, end, lineCount, parent) { fKeyWord = keyWord; fType = Type::kKeyWord; } - Definition(Punctuation punctuation, const char* start, int lineCount, Definition* parent) + Definition(Punctuation punctuation, const char* start, int lineCount, Definition* parent) : Definition(start, nullptr, lineCount, parent) { fPunctuation = punctuation; fType = Type::kPunctuation; @@ -870,7 +870,7 @@ public: bool methodHasReturn(const string& name, TextParser* methodParser) const; string methodName() const; - bool nextMethodParam(TextParser* methodParser, const char** nextEndPtr, + bool nextMethodParam(TextParser* methodParser, const char** nextEndPtr, string* paramName) const; bool paramsMatch(const string& fullRef, const string& name) const; @@ -930,12 +930,12 @@ public: RootDefinition() { } - + RootDefinition(MarkType markType, const char* start, int line, Definition* parent) : Definition(markType, start, line, parent) { } - RootDefinition(MarkType markType, const char* start, const char* end, int line, + RootDefinition(MarkType markType, const char* start, const char* end, int line, Definition* parent) : Definition(markType, start, end, line, parent) { } @@ -1262,7 +1262,7 @@ public: #define E_O Exemplary::kOptional BmhParser() : ParserCommon() - , fMaps { + , fMaps { // names without formal definitions (e.g. Column) aren't included // fill in other names once they're actually used { "", nullptr, MarkType::kNone, R_Y, E_N, 0 } @@ -1270,7 +1270,7 @@ public: , { "Alias", nullptr, MarkType::kAlias, R_N, E_N, 0 } , { "Bug", nullptr, MarkType::kBug, R_N, E_N, 0 } , { "Class", &fClassMap, MarkType::kClass, R_Y, E_O, M_CSST | M(Root) } -, { "Code", nullptr, MarkType::kCode, R_O, E_N, M_CSST | M_E } +, { "Code", nullptr, MarkType::kCode, R_O, E_N, M_CSST | M_E } , { "", nullptr, MarkType::kColumn, R_Y, E_N, M(Row) } , { "", nullptr, MarkType::kComment, R_N, E_N, 0 } , { "Const", &fConstMap, MarkType::kConst, R_Y, E_N, M_E | M_ST } @@ -1286,7 +1286,7 @@ public: , { "Experimental", nullptr, MarkType::kExperimental, R_Y, E_N, 0 } , { "External", nullptr, MarkType::kExternal, R_Y, E_N, M(Root) } , { "File", nullptr, MarkType::kFile, R_N, E_N, M(Track) } -, { "Formula", nullptr, MarkType::kFormula, R_O, E_N, +, { "Formula", nullptr, MarkType::kFormula, R_O, E_N, M(Column) | M_ST | M(Member) | M(Method) | M_D } , { "Function", nullptr, MarkType::kFunction, R_O, E_N, M(Example) } , { "Height", nullptr, MarkType::kHeight, R_N, E_N, M(Example) } @@ -1408,7 +1408,7 @@ public: Exemplary fExemplary; // worthy of an example uint64_t fParentMask; }; - + DefinitionMap fMaps[Last_MarkType + 1]; forward_list fTopics; forward_list fMarkup; @@ -1754,7 +1754,7 @@ protected: unordered_map* fInclude; MarkType fMarkType; }; - + DefinitionMap fMaps[Last_MarkType + 1]; unordered_map fIncludeMap; unordered_map fIClassMap; @@ -1814,7 +1814,7 @@ public: }; struct IterState { - IterState (list::iterator tIter, list::iterator tIterEnd) + IterState (list::iterator tIter, list::iterator tIterEnd) : fDefIter(tIter) , fDefEnd(tIterEnd) { } @@ -1846,10 +1846,10 @@ public: void enumMembersOut(const RootDefinition* root, Definition& child); void enumSizeItems(const Definition& child); int lookupMethod(const PunctuationState punctuation, const Word word, - const int start, const int run, int lastWrite, + const int start, const int run, int lastWrite, const char* data, bool hasIndirection); int lookupReference(const PunctuationState punctuation, const Word word, - const int start, const int run, int lastWrite, const char last, + const int start, const int run, int lastWrite, const char last, const char* data); void methodOut(const Definition* method, const Definition& child); bool populate(Definition* def, ParentPair* parentPair, RootDefinition* root); @@ -1973,7 +1973,7 @@ private: string linkName(const Definition* ) const; string linkRef(const string& leadingSpaces, const Definition*, const string& ref) const; void markTypeOut(Definition* ); - void mdHeaderOut(int depth) { mdHeaderOutLF(depth, 2); } + void mdHeaderOut(int depth) { mdHeaderOutLF(depth, 2); } void mdHeaderOutLF(int depth, int lf); bool parseFromFile(const char* path) override { return true; @@ -1992,7 +1992,7 @@ private: } BmhParser::Resolvable resolvable(MarkType markType) { - if ((MarkType::kExample == markType + if ((MarkType::kExample == markType || MarkType::kFunction == markType) && fHasFiddle) { return BmhParser::Resolvable::kNo; } diff --git a/tools/bookmaker/includeParser.cpp b/tools/bookmaker/includeParser.cpp index ee2b95a134..1e055db17f 100644 --- a/tools/bookmaker/includeParser.cpp +++ b/tools/bookmaker/includeParser.cpp @@ -94,7 +94,7 @@ void IncludeParser::addKeyword(KeyWord keyWord) { } } -void IncludeParser::checkForMissingParams(const vector& methodParams, +void IncludeParser::checkForMissingParams(const vector& methodParams, const vector& foundParams) { for (auto& methodParam : methodParams) { bool found = false; @@ -330,7 +330,7 @@ bool IncludeParser::crossCheck(BmhParser& bmhParser) { const char* savePos = firstMember.fChar; firstMember.skipToNonAlphaNum(); const char* wordEnd = firstMember.fChar; - firstMember.fChar = savePos; + firstMember.fChar = savePos; const char* lastUnderscore = nullptr; do { if (!firstMember.skipToEndBracket('_')) { @@ -343,7 +343,7 @@ bool IncludeParser::crossCheck(BmhParser& bmhParser) { } while (firstMember.next()); if (lastUnderscore) { ++lastUnderscore; - string anonName = className + "::" + string(lastUnderscore, + string anonName = className + "::" + string(lastUnderscore, wordEnd - lastUnderscore) + 's'; def = root->find(anonName, RootDefinition::AllowParens::kYes); } @@ -394,7 +394,7 @@ bool IncludeParser::crossCheck(BmhParser& bmhParser) { } break; default: - SkASSERT(0); // unhandled + SkASSERT(0); // unhandled break; } } @@ -418,7 +418,7 @@ IClassDefinition* IncludeParser::defineClass(const Definition& includeDef, } test = test->fParent; } - className += name; + className += name; unordered_map& map = fIClassMap; IClassDefinition& markupDef = map[className]; if (markupDef.fStart) { @@ -727,7 +727,7 @@ void IncludeParser::dumpMethod(const Definition& token) { this->writeString("macro expands to: void toString(SkString* str) const;"); this->writeEndTag(); this->lf(2); - const char desc[] = + const char desc[] = "Creates string representation. The representation is read by\n" "internal debugging tools. The interface and implementation may be\n" "suppressed by defining SK_IGNORE_TO_STRING."; @@ -770,7 +770,7 @@ bool IncludeParser::dumpTokens(const string& dir) { return true; } - // dump equivalent markup + // dump equivalent markup bool IncludeParser::dumpTokens(const string& dir, const string& skClassName) { string fileName = dir; if (dir.length() && '/' != dir[dir.length() - 1]) { @@ -1009,7 +1009,7 @@ bool IncludeParser::parseClass(Definition* includeDef, IsStruct isStruct) { } if ('{' == iter->fStart[0] && Definition::Type::kPunctuation == iter->fType) { break; - } + } } while (static_cast(iter = std::next(iter)), true); if (Punctuation::kLeftBrace != iter->fPunctuation) { return iter->reportError("expected left brace"); @@ -1109,7 +1109,7 @@ bool IncludeParser::parseComment(const string& filename, const char* start, cons break; } const char* lineEnd = parser.trimmedLineEnd(); - markupDef->fTokens.emplace_back(MarkType::kComment, parser.fChar, lineEnd, + markupDef->fTokens.emplace_back(MarkType::kComment, parser.fChar, lineEnd, parser.fLineCount, parent); parser.skipToEndBracket('\n'); } @@ -1144,7 +1144,7 @@ bool IncludeParser::parseEnum(Definition* child, Definition* markupDef) { } const char* nameStart = enumName.fChar; enumName.skipToSpace(); - markupChild->fName = markupDef->fName + "::" + + markupChild->fName = markupDef->fName + "::" + string(nameStart, (size_t) (enumName.fChar - nameStart)); if (!this->findComments(*child, markupChild)) { return false; @@ -1435,7 +1435,7 @@ bool IncludeParser::parseObject(Definition* child, Definition* markupDef) { switch (child->fType) { case Definition::Type::kKeyWord: switch (child->fKeyWord) { - case KeyWord::kClass: + case KeyWord::kClass: if (!this->parseClass(child, IsStruct::kNo)) { return false; } @@ -1635,7 +1635,7 @@ bool IncludeParser::parseChar() { this->popBracket(); } break; - } + } if (!fInCharCommentString && '/' == fPrev) { this->pushBracket(Bracket::kSlashSlash); break; @@ -1753,7 +1753,7 @@ bool IncludeParser::parseChar() { if ("SK_ATTR_EXTERNALLY_DEPRECATED" == word) { deprecatedMacro = true; // remove macro paren (would confuse method parsing later) - fParent->fTokens.pop_back(); + fParent->fTokens.pop_back(); fParent->fChildren.pop_back(); } break; @@ -1949,7 +1949,7 @@ bool IncludeParser::parseChar() { case 'k': case 'l': case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': case 's': case 't': case 'u': case 'v': case 'w': case 'x': case 'y': - case 'z': + case 'z': if (fInCharCommentString || fInBrace) { break; } diff --git a/tools/bookmaker/includeWriter.cpp b/tools/bookmaker/includeWriter.cpp index e2215a6e1c..38213618c5 100644 --- a/tools/bookmaker/includeWriter.cpp +++ b/tools/bookmaker/includeWriter.cpp @@ -16,7 +16,7 @@ void IncludeWriter::descriptionOut(const Definition* def) { case MarkType::kDefinedBy: commentStart = prop->fTerminator; break; - case MarkType::kDeprecated: + case MarkType::kDeprecated: case MarkType::kPrivate: commentLen = (int) (prop->fStart - commentStart); if (commentLen > 0) { @@ -308,7 +308,7 @@ void IncludeWriter::enumMembersOut(const RootDefinition* root, Definition& child if (' ' == lastEnd[0]) { this->writeSpace(); } - this->writeBlock((int) (token->fContentEnd - lastEnd), lastEnd); + this->writeBlock((int) (token->fContentEnd - lastEnd), lastEnd); continue; } } @@ -477,7 +477,7 @@ void IncludeWriter::enumSizeItems(const Definition& child) { token.fContentStart, token.fLineCount); const char* end = valueEnd.anyOf(",}"); if (!end) { // write expression continuation - valueLen += (int) (token.fContentEnd - lastEnd); + valueLen += (int) (token.fContentEnd - lastEnd); continue; } } @@ -545,7 +545,7 @@ void IncludeWriter::methodOut(const Definition* method, const Definition& child) int saveIndent = fIndent; for (auto methodPart : method->fChildren) { const char* partStart = methodPart->fContentStart; - const char* partEnd = methodPart->fContentEnd; + const char* partEnd = methodPart->fContentEnd; if (MarkType::kParam == methodPart->fMarkType) { this->writeString("@param"); this->writeSpace(); @@ -628,7 +628,7 @@ Definition* IncludeWriter::structMemberOut(const Definition* memberStart, const if (MarkType::kFormula == child->fMarkType) { this->writeSpace(); this->writeBlock((int) (child->fContentEnd - child->fContentStart), - child->fContentStart); + child->fContentStart); } commentStart = child->fTerminator; } @@ -660,7 +660,7 @@ Definition* IncludeWriter::structMemberOut(const Definition* memberStart, const this->writeString("="); this->writeSpace(); this->writeBlock((int) (valueEnd->fStart - valueStart->fContentStart), - valueStart->fContentStart); + valueStart->fContentStart); } this->writeString(";"); if (isShort) { @@ -849,7 +849,7 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti SkASSERT(')' == child.fContentStart[childLen]); ++childLen; do { - TextParser params(clonedMethod->fFileName, clonedMethod->fStart, + TextParser params(clonedMethod->fFileName, clonedMethod->fStart, clonedMethod->fContentStart, clonedMethod->fLineCount); params.skipToEndBracket('('); if (params.startsWith(child.fContentStart, childLen)) { @@ -925,7 +925,7 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti } fLastComment = &child; continue; - } + } if (MarkType::kMethod == child.fMarkType) { if (this->internalName(child)) { continue; @@ -958,7 +958,7 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti fAttrDeprecated = nullptr; } continue; - } + } if (Definition::Type::kKeyWord == child.fType) { const Definition* structDef = nullptr; switch (child.fKeyWord) { @@ -1104,9 +1104,9 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti } } continue; - } + } if (Definition::Type::kBracket == child.fType) { - if (KeyWord::kEnum == child.fParent->fKeyWord || + if (KeyWord::kEnum == child.fParent->fKeyWord || (KeyWord::kClass == child.fParent->fKeyWord && child.fParent->fParent && KeyWord::kEnum == child.fParent->fParent->fKeyWord)) { SkASSERT(Bracket::kBrace == child.fBracket); @@ -1265,7 +1265,7 @@ string IncludeWriter::resolveMethod(const char* start, const char* end, bool fir string IncludeWriter::resolveRef(const char* start, const char* end, bool first, RefType* refType) { - // look up Xxx_Xxx + // look up Xxx_Xxx string undername(start, end - start); for (const auto& external : fBmhParser->fExternals) { if (external.fName == undername) { @@ -1406,7 +1406,7 @@ int IncludeWriter::lookupReference(const PunctuationState punctuation, const Wor if (Word::kFirst != word && '_' != last) { temp = ConvertRef(resolved, false); } - } + } if (temp.length()) { if (start > lastWrite) { SkASSERT(data[start - 1] >= ' '); @@ -1503,7 +1503,7 @@ IncludeWriter::Wrote IncludeWriter::rewriteBlock(int size, const char* data, Phr SkASSERT(0); } punctuation = PunctuationState::kPeriod == punctuation || - (PunctuationState::kStart == punctuation && ' ' >= last) ? + (PunctuationState::kStart == punctuation && ' ' >= last) ? PunctuationState::kStart : PunctuationState::kSpace; word = Word::kStart; embeddedIndirection = false; @@ -1639,7 +1639,7 @@ IncludeWriter::Wrote IncludeWriter::rewriteBlock(int size, const char* data, Phr case 'k': case 'l': case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': case 's': case 't': case 'u': case 'v': case 'w': case 'x': case 'y': - case 'z': + case 'z': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '-': diff --git a/tools/bookmaker/mdOut.cpp b/tools/bookmaker/mdOut.cpp index 14e34a0131..242d667736 100644 --- a/tools/bookmaker/mdOut.cpp +++ b/tools/bookmaker/mdOut.cpp @@ -134,19 +134,19 @@ string MdOut::addReferences(const char* refStart, const char* refEnd, // methods may start with upper (static) or lower (most) // see if this should have been a findable reference - + // look for Sk / sk / SK .. if (!ref.compare(0, 2, "Sk") && ref != "Skew" && ref != "Skews" && ref != "Skip" && ref != "Skips") { t.reportError("missed Sk prefixed"); return result; - } + } if (!ref.compare(0, 2, "SK")) { if (BmhParser::Resolvable::kOut != resolvable) { t.reportError("missed SK prefixed"); } return result; - } + } if (!isupper(start[0])) { // TODO: // look for all lowercase w/o trailing parens as mistaken method matches @@ -157,7 +157,7 @@ string MdOut::addReferences(const char* refStart, const char* refEnd, fLastParam = def; distFromParam = 0; continue; - } else if (!fInDescription && ref[0] != '0' + } else if (!fInDescription && ref[0] != '0' && string::npos != ref.find_first_of("ABCDEFGHIJKLMNOPQRSTUVWXYZ")) { // FIXME: see isDefined(); check to see if fXX is a member of xx.fXX if (('f' != ref[0] && string::npos == ref.find("()")) @@ -386,7 +386,7 @@ const Definition* MdOut::findParamType() { return paramType; } if (isupper(name[0])) { - lastFull = name; + lastFull = name; } } while (true); return nullptr; @@ -784,7 +784,7 @@ void MdOut::markTypeOut(Definition* def) { case MarkType::kParam: { if (TableState::kNone == fTableState) { this->mdHeaderOut(3); - fprintf(fOut, + fprintf(fOut, "Parameters\n" "\n" "" @@ -811,7 +811,7 @@ void MdOut::markTypeOut(Definition* def) { return; } string refNameStr = def->fParent->fFiddle + "_" + paramNameStr; - fprintf(fOut, + fprintf(fOut, "
%s ", refNameStr.c_str(), paramNameStr.c_str()); } break; @@ -841,7 +841,7 @@ void MdOut::markTypeOut(Definition* def) { case MarkType::kStdOut: { TextParser code(def); this->mdHeaderOut(4); - fprintf(fOut, + fprintf(fOut, "Example Output\n" "\n" "~~~~"); diff --git a/tools/bookmaker/spellCheck.cpp b/tools/bookmaker/spellCheck.cpp index 6e80ee77c2..b2091640d0 100644 --- a/tools/bookmaker/spellCheck.cpp +++ b/tools/bookmaker/spellCheck.cpp @@ -10,7 +10,7 @@ #include "SkOSFile.h" #include "SkOSPath.h" -/* +/* things to do if cap word is beginning of sentence, add it to table as lower-case word must have only a single initial capital @@ -428,7 +428,7 @@ void SpellCheck::leafCheck(const char* start, const char* end) { case 'k': case 'l': case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': case 's': case 't': case 'u': case 'v': case 'w': case 'x': case 'y': - case 'z': + case 'z': if (!wordStart) { wordStart = chPtr; wordEnd = nullptr; @@ -441,7 +441,7 @@ void SpellCheck::leafCheck(const char* start, const char* end) { break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': - case '_': + case '_': allLower = false; case '-': // note that dash doesn't clear allLower break; @@ -603,7 +603,7 @@ void SpellCheck::wordCheck(const string& str) { } bool inCode = fInCode; if (hasUnderscore && isupper(str[0]) && ('S' != str[0] || 'K' != str[1]) - && !hasColon && !hasDot && !hasParen && !fInStdOut && !inCode && !fInConst + && !hasColon && !hasDot && !hasParen && !fInStdOut && !inCode && !fInConst && !sawDigit && !sawSpecial && !sawDash) { std::istringstream ss(str); string token; @@ -612,7 +612,7 @@ void SpellCheck::wordCheck(const string& str) { } return; } - if (!hasColon && !hasDot && !hasParen && !hasUnderscore + if (!hasColon && !hasDot && !hasParen && !hasUnderscore && !fInStdOut && !inCode && !fInConst && !sawDigit && islower(str[0]) && isupper(str[1])) { inCode = true; @@ -626,7 +626,7 @@ void SpellCheck::wordCheck(const string& str) { } } } - auto& mappy = hasColon ? fColons : + auto& mappy = hasColon ? fColons : hasDot ? fDots : hasParen ? fParens : hasUnderscore ? fUnderscores : diff --git a/tools/get_current_monitor_profile.cpp b/tools/get_current_monitor_profile.cpp index 55a96d56dd..096ecd01ce 100644 --- a/tools/get_current_monitor_profile.cpp +++ b/tools/get_current_monitor_profile.cpp @@ -19,10 +19,10 @@ int main(int argc, char** argv) { CFDataRef dataRef = CGColorSpaceCopyICCProfile(cs); const uint8_t* data = CFDataGetBytePtr(dataRef); size_t size = CFDataGetLength(dataRef); - + SkFILEWStream file("monitor_0.icc"); file.write(data, size); - + CFRelease(cs); CFRelease(dataRef); return 0; diff --git a/tools/merge_static_libs.py b/tools/merge_static_libs.py index 842be18c84..a32c3a5024 100755 --- a/tools/merge_static_libs.py +++ b/tools/merge_static_libs.py @@ -15,7 +15,7 @@ def _Usage(): def MergeLibs(in_libs, out_lib): """ Merges multiple static libraries into one. - + in_libs: list of paths to static libraries to be merged out_lib: path to the static library which will be created from in_libs """ @@ -38,12 +38,12 @@ def MergeLibs(in_libs, out_lib): proc.wait() if proc.poll() == 0: # The static library is non-thin, and we extracted objects - for object in current_objects: - objects.append(os.path.abspath(object)) + for obj in current_objects: + objects.append(os.path.abspath(obj)) elif 'thin archive' in proc.communicate()[0]: # The static library is thin, so it contains the paths to its objects - for object in current_objects: - objects.append(object) + for obj in current_objects: + objects.append(obj) else: raise Exception('Failed to extract objects from %s.' % in_lib) os.chdir(curdir) diff --git a/tools/mirror-dev.sh b/tools/mirror-dev.sh index 0512a78ea3..eb948f4417 100755 --- a/tools/mirror-dev.sh +++ b/tools/mirror-dev.sh @@ -1,3 +1,7 @@ +# Copyright 2013 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + # For each installed *-dev package DEV for DEV in $(dpkg --list | grep '^ii [^ ]' | cut -d ' ' -f 3 | grep '\-dev$') do @@ -10,14 +14,14 @@ echo "$DEV installed $DEV_64_SO which is real." continue fi - + DEV_64_TARGET=$(readlink $DEV_64_SO) - DEV_64_TARGET_FULL=$(readlink -f $DEV_64_SO) - + DEV_64_TARGET_FULL=$(readlink -f $DEV_64_SO) + DEV_32_SO=$(echo $DEV_64_SO | sed -e 's@/lib/x86_64-linux-gnu/@/lib/i386-linux-gnu/@') DEV_32_TARGET=$(echo $DEV_64_TARGET | sed -e 's@/lib/x86_64-linux-gnu/@/lib/i386-linux-gnu/@') DEV_32_TARGET_FULL=$(echo $DEV_64_TARGET_FULL | sed -e 's@/lib/x86_64-linux-gnu/@/lib/i386-linux-gnu/@') - + # Error if DEV_32_TARGET does not exist. if ! test -e $DEV_32_TARGET_FULL then @@ -27,7 +31,7 @@ #echo " $DEV_32_SO -> $DEV_32_TARGET ($DEV_32_TARGET_FULL)" continue fi - + # Create DEV_32_SO sudo ln -s $DEV_32_TARGET $DEV_32_SO done diff --git a/tools/skiaserve/tester/tester.py b/tools/skiaserve/tester/tester.py index b99529c7c3..9bf4c519f4 100644 --- a/tools/skiaserve/tester/tester.py +++ b/tools/skiaserve/tester/tester.py @@ -57,7 +57,7 @@ class SkiaServeTester: def post(self): with open(self.skp, 'rb') as payload: files = {'file': payload} - + # upload skp return Check(requests.post(self.url + '/new', files=files)) @@ -73,7 +73,7 @@ class SkiaServeTester: def enable_gpu(self): return Check(requests.post(self.url + '/enableGPU/1')) - + def disable_gpu(self): return Check(requests.post(self.url + '/enableGPU/0')) diff --git a/tools/test_gpuveto.py b/tools/test_gpuveto.py index fbb29aefc6..589b403b59 100755 --- a/tools/test_gpuveto.py +++ b/tools/test_gpuveto.py @@ -45,7 +45,7 @@ def execute_program(args): @returns a tuple of the process output (returncode, output) """ - proc = subprocess.Popen(args, stdout=subprocess.PIPE, + proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) output, _ = proc.communicate() errcode = proc.returncode @@ -71,11 +71,12 @@ class GpuVeto(object): for skp in enumerate(dir_or_file): self.process_skp(skp[1]) - sys.stdout.write('TP %d FP %d TN %d FN %d IND %d\n' % (self.truePositives, - self.falsePositives, - self.trueNegatives, - self.falseNegatives, - self.indeterminate)) + sys.stdout.write('TP %d FP %d TN %d FN %d IND %d\n' % ( + self.truePositives, + self.falsePositives, + self.trueNegatives, + self.falseNegatives, + self.indeterminate)) def process_skp(self, skp_file): @@ -95,7 +96,7 @@ class GpuVeto(object): suitable = True # run raster config - args = [self.bench_pictures, '-r', skp_file, + args = [self.bench_pictures, '-r', skp_file, '--repeat', '20', '--timers', 'w', '--config', '8888'] @@ -110,7 +111,7 @@ class GpuVeto(object): rasterTime = float(matches[0]) # run gpu config - args2 = [self.bench_pictures, '-r', skp_file, + args2 = [self.bench_pictures, '-r', skp_file, '--repeat', '20', '--timers', 'w', '--config', 'gpu'] @@ -132,7 +133,7 @@ class GpuVeto(object): tol_range = tolerance * gpuTime - if rasterTime > gpuTime - tol_range and rasterTime < gpuTime + tol_range: + if gpuTime - tol_range < rasterTime < gpuTime + tol_range: result = "NONE" self.indeterminate += 1 elif suitable: @@ -149,10 +150,10 @@ class GpuVeto(object): else: self.trueNegatives += 1 result = "TN" - - sys.stdout.write('%s: gpuveto: %d raster %.2f gpu: %.2f Result: %s\n' % ( - skp_file, suitable, rasterTime, gpuTime, result)) + + sys.stdout.write('%s: gpuveto: %d raster %.2f gpu: %.2f Result: %s\n' + % (skp_file, suitable, rasterTime, gpuTime, result)) def main(main_argv): parser = argparse.ArgumentParser() diff --git a/tools/viewer/sk_app/Window.cpp b/tools/viewer/sk_app/Window.cpp index 9acea3f415..d7904fd8a7 100644 --- a/tools/viewer/sk_app/Window.cpp +++ b/tools/viewer/sk_app/Window.cpp @@ -19,12 +19,12 @@ static bool default_char_func(SkUnichar c, uint32_t modifiers, void* userData) { return false; } -static bool default_key_func(Window::Key key, Window::InputState state, uint32_t modifiers, +static bool default_key_func(Window::Key key, Window::InputState state, uint32_t modifiers, void* userData) { return false; } -static bool default_mouse_func(int x, int y, Window::InputState state, uint32_t modifiers, +static bool default_mouse_func(int x, int y, Window::InputState state, uint32_t modifiers, void* userData) { return false; } diff --git a/tools/viewer/sk_app/ios/Window_ios.cpp b/tools/viewer/sk_app/ios/Window_ios.cpp index d37269703c..c1bdeae5fc 100644 --- a/tools/viewer/sk_app/ios/Window_ios.cpp +++ b/tools/viewer/sk_app/ios/Window_ios.cpp @@ -31,7 +31,7 @@ bool Window_ios::initWindow() { // we already have a window if (fWindow) { return true; - } + } constexpr int initialWidth = 1280; constexpr int initialHeight = 960; diff --git a/tools/viewer/sk_app/mac/GLWindowContext_mac.cpp b/tools/viewer/sk_app/mac/GLWindowContext_mac.cpp index 2515ea471a..7f09d54522 100644 --- a/tools/viewer/sk_app/mac/GLWindowContext_mac.cpp +++ b/tools/viewer/sk_app/mac/GLWindowContext_mac.cpp @@ -21,18 +21,18 @@ namespace { class GLWindowContext_mac : public GLWindowContext { public: GLWindowContext_mac(const MacWindowInfo&, const DisplayParams&); - + ~GLWindowContext_mac() override; - + void onSwapBuffers() override; sk_sp onInitializeContext() override; void onDestroyContext() override; - + private: SDL_Window* fWindow; SDL_GLContext fGLContext; - + typedef GLWindowContext INHERITED; }; diff --git a/tools/viewer/sk_app/mac/RasterWindowContext_mac.cpp b/tools/viewer/sk_app/mac/RasterWindowContext_mac.cpp index 04fea84e05..409c49f218 100644 --- a/tools/viewer/sk_app/mac/RasterWindowContext_mac.cpp +++ b/tools/viewer/sk_app/mac/RasterWindowContext_mac.cpp @@ -108,7 +108,7 @@ void RasterWindowContext_mac::onSwapBuffers() { if (fWindow && fGLContext) { // We made/have an off-screen surface. Get the contents as an SkImage: sk_sp snapshot = fBackbufferSurface->makeImageSnapshot(); - + sk_sp gpuSurface = INHERITED::getBackbufferSurface(); SkCanvas* gpuCanvas = gpuSurface->getCanvas(); gpuCanvas->drawImage(snapshot, 0, 0); diff --git a/tools/viewer/sk_app/mac/Window_mac.cpp b/tools/viewer/sk_app/mac/Window_mac.cpp index dff7ccbe67..8de5b10450 100644 --- a/tools/viewer/sk_app/mac/Window_mac.cpp +++ b/tools/viewer/sk_app/mac/Window_mac.cpp @@ -31,7 +31,7 @@ bool Window_mac::initWindow() { // we already have a window if (fWindow) { return true; - } + } constexpr int initialWidth = 1280; constexpr int initialHeight = 960; @@ -255,7 +255,7 @@ bool Window_mac::attach(BackendType attachType) { case kRaster_BackendType: fWindowContext = NewRasterForMac(info, fRequestedDisplayParams); break; - + case kNativeGL_BackendType: default: fWindowContext = NewGLForMac(info, fRequestedDisplayParams); diff --git a/tools/viewer/sk_app/mac/Window_mac.h b/tools/viewer/sk_app/mac/Window_mac.h index eb28ff42da..aa5c8df696 100644 --- a/tools/viewer/sk_app/mac/Window_mac.h +++ b/tools/viewer/sk_app/mac/Window_mac.h @@ -53,9 +53,9 @@ private: SDL_Window* fWindow; Uint32 fWindowID; - + int fMSAASampleCount; - + typedef Window INHERITED; }; diff --git a/tools/viewer/sk_app/mac/main_mac.cpp b/tools/viewer/sk_app/mac/main_mac.cpp index b30a7ea781..6dcf5b93f7 100644 --- a/tools/viewer/sk_app/mac/main_mac.cpp +++ b/tools/viewer/sk_app/mac/main_mac.cpp @@ -38,11 +38,11 @@ int main(int argc, char* argv[]) { case SDL_TEXTINPUT: done = sk_app::Window_mac::HandleWindowEvent(event); break; - + case SDL_QUIT: done = true; break; - + default: break; } diff --git a/tools/viewer/sk_app/unix/Window_unix.cpp b/tools/viewer/sk_app/unix/Window_unix.cpp index ef0d85e0ce..f5ca5ee073 100644 --- a/tools/viewer/sk_app/unix/Window_unix.cpp +++ b/tools/viewer/sk_app/unix/Window_unix.cpp @@ -37,8 +37,8 @@ Window* Window::CreateNativeWindow(void* platformData) { return window; } -const long kEventMask = ExposureMask | StructureNotifyMask | - KeyPressMask | KeyReleaseMask | +const long kEventMask = ExposureMask | StructureNotifyMask | + KeyPressMask | KeyReleaseMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask; bool Window_unix::initWindow(Display* display) { @@ -308,10 +308,10 @@ bool Window_unix::handleEvent(const XEvent& event) { KeySym keysym = XkbKeycodeToKeysym(fDisplay, event.xkey.keycode, 0, shiftLevel); Window::Key key = get_key(keysym); - (void) this->onKey(key, Window::kUp_InputState, + (void) this->onKey(key, Window::kUp_InputState, get_modifiers(event)); } break; - + default: // these events should be handled in the main event loop @@ -325,7 +325,7 @@ bool Window_unix::handleEvent(const XEvent& event) { void Window_unix::setTitle(const char* title) { XTextProperty textproperty; XStringListToTextProperty(const_cast(&title), 1, &textproperty); - XSetWMName(fDisplay, fWindow, &textproperty); + XSetWMName(fDisplay, fWindow, &textproperty); } void Window_unix::show() { @@ -380,7 +380,7 @@ void Window_unix::onInval() { event.xexpose.width = this->width(); event.xexpose.height = this->height(); event.xexpose.count = 0; - + XSendEvent(fDisplay, fWindow, False, 0, &event); } diff --git a/tools/viewer/sk_app/unix/Window_unix.h b/tools/viewer/sk_app/unix/Window_unix.h index 73f21af94a..b59f502eb9 100644 --- a/tools/viewer/sk_app/unix/Window_unix.h +++ b/tools/viewer/sk_app/unix/Window_unix.h @@ -51,10 +51,10 @@ public: static SkTDynamicHash gWindowMap; void markPendingPaint() { fPendingPaint = true; } - void finishPaint() { + void finishPaint() { if (fPendingPaint) { - this->onPaint(); - fPendingPaint = false; + this->onPaint(); + fPendingPaint = false; } } @@ -65,11 +65,11 @@ public: fPendingHeight = height; } } - void finishResize() { + void finishResize() { if (fPendingResize) { - this->onResize(fPendingWidth, fPendingHeight); + this->onResize(fPendingWidth, fPendingHeight); fPendingResize = false; - } + } } private: diff --git a/tools/viewer/sk_app/unix/main_unix.cpp b/tools/viewer/sk_app/unix/main_unix.cpp index 2837c0332e..4d9a64d6b6 100644 --- a/tools/viewer/sk_app/unix/main_unix.cpp +++ b/tools/viewer/sk_app/unix/main_unix.cpp @@ -74,9 +74,9 @@ int main(int argc, char**argv) { done = true; } break; - } + } } - + pendingWindows.foreach(finishWindow); if (pendingWindows.count() > 0) { app->onIdle(); diff --git a/tools/viewer/sk_app/win/Window_win.cpp b/tools/viewer/sk_app/win/Window_win.cpp index 5b73b44761..10db0ec675 100644 --- a/tools/viewer/sk_app/win/Window_win.cpp +++ b/tools/viewer/sk_app/win/Window_win.cpp @@ -101,7 +101,7 @@ bool Window_win::init(HINSTANCE hInstance) { // Set the position of the window to the top left corner. posX = posY = 0; - } + } */ // gIsFullscreen = fullscreen; @@ -235,19 +235,19 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) break; case WM_UNICHAR: - eventHandled = window->onChar((SkUnichar)wParam, + eventHandled = window->onChar((SkUnichar)wParam, get_modifiers(message, wParam, lParam)); break; case WM_CHAR: { const uint16_t* c = reinterpret_cast(&wParam); - eventHandled = window->onChar(SkUTF16_NextUnichar(&c), + eventHandled = window->onChar(SkUTF16_NextUnichar(&c), get_modifiers(message, wParam, lParam)); } break; case WM_KEYDOWN: case WM_SYSKEYDOWN: - eventHandled = window->onKey(get_key(wParam), Window::kDown_InputState, + eventHandled = window->onKey(get_key(wParam), Window::kDown_InputState, get_modifiers(message, wParam, lParam)); break; @@ -273,7 +273,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) Window::InputState istate = ((wParam & MK_LBUTTON) != 0) ? Window::kDown_InputState : Window::kUp_InputState; - eventHandled = window->onMouse(xPos, yPos, istate, + eventHandled = window->onMouse(xPos, yPos, istate, get_modifiers(message, wParam, lParam)); } break; -- cgit v1.2.3