diff options
author | Kevin Lubick <kjlubick@google.com> | 2018-01-05 10:11:11 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-01-05 18:03:25 +0000 |
commit | 4284613cfe211bfdcf3506f363d382c044ae8b51 (patch) | |
tree | 1004283289d9e70c786dd01702c8a8b144aa5932 /src | |
parent | 4c79ecf2f493c0eaa4f58cf0bb086d61ea2aebcb (diff) |
Enable conditional-uninitialized flag
Bug: skia:7462
Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SKNX_NO_SIMD
Change-Id: I1c0a09984bf28a5c620a89af56040f018bae6310
Reviewed-on: https://skia-review.googlesource.com/90941
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkRegion.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrDrawingManager.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrRectanizer_skyline.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrTextureMaker.cpp | 8 | ||||
-rw-r--r-- | src/gpu/ccpr/GrCCPRCoverageOp.cpp | 4 | ||||
-rw-r--r-- | src/gpu/ops/GrMSAAPathRenderer.cpp | 2 | ||||
-rw-r--r-- | src/gpu/vk/GrVkPipeline.cpp | 2 | ||||
-rw-r--r-- | src/opts/SkBlitMask_opts_arm_neon.cpp | 32 | ||||
-rw-r--r-- | src/pathops/SkPathOpsOp.cpp | 2 | ||||
-rw-r--r-- | src/ports/SkFontHost_FreeType.cpp | 2 | ||||
-rw-r--r-- | src/ports/SkFontHost_win.cpp | 2 |
11 files changed, 23 insertions, 37 deletions
diff --git a/src/core/SkRegion.cpp b/src/core/SkRegion.cpp index 30978854c5..ba185ae38c 100644 --- a/src/core/SkRegion.cpp +++ b/src/core/SkRegion.cpp @@ -1200,7 +1200,7 @@ static bool validate_run(const int32_t* runs, return false; // too many intervals } bool firstInterval = true; - int32_t lastRight; // check that x-intervals are distinct and ordered. + int32_t lastRight = 0; // check that x-intervals are distinct and ordered. while (xIntervals-- > 0) { rect.fLeft = *runs++; rect.fRight = *runs++; diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp index b75dd1c3c4..22afd03065 100644 --- a/src/gpu/GrDrawingManager.cpp +++ b/src/gpu/GrDrawingManager.cpp @@ -285,7 +285,7 @@ GrSemaphoresSubmitted GrDrawingManager::prepareSurfaceForExternalIO( } SkASSERT(proxy); - GrSemaphoresSubmitted result; + GrSemaphoresSubmitted result = GrSemaphoresSubmitted::kNo; if (proxy->priv().hasPendingIO() || numSemaphores) { result = this->flush(proxy, numSemaphores, backendSemaphores); } diff --git a/src/gpu/GrRectanizer_skyline.cpp b/src/gpu/GrRectanizer_skyline.cpp index bbb9859d8e..c4d26e026d 100644 --- a/src/gpu/GrRectanizer_skyline.cpp +++ b/src/gpu/GrRectanizer_skyline.cpp @@ -16,7 +16,7 @@ bool GrRectanizerSkyline::addRect(int width, int height, SkIPoint16* loc) { // find position for new rectangle int bestWidth = this->width() + 1; - int bestX; + int bestX = 0; int bestY = this->height() + 1; int bestIndex = -1; for (int i = 0; i < fSkyline.count(); ++i) { diff --git a/src/gpu/GrTextureMaker.cpp b/src/gpu/GrTextureMaker.cpp index b3a16f5d8c..6cb9832b59 100644 --- a/src/gpu/GrTextureMaker.cpp +++ b/src/gpu/GrTextureMaker.cpp @@ -42,16 +42,12 @@ sk_sp<GrTextureProxy> GrTextureMaker::refTextureProxyForParams(const GrSamplerSt } } - GrSurfaceOrigin origOrigin; + GrSurfaceOrigin origOrigin = original ? original->origin() + : kTopLeft_GrSurfaceOrigin; GrUniqueKey copyKey; this->makeCopyKey(copyParams, ©Key, dstColorSpace); sk_sp<GrTextureProxy> cachedProxy; if (copyKey.isValid()) { - if (original) { - origOrigin = original->origin(); - } else { - origOrigin = kTopLeft_GrSurfaceOrigin; - } cachedProxy = fContext->resourceProvider()->findOrCreateProxyByUniqueKey(copyKey, origOrigin); if (cachedProxy && (!willBeMipped || GrMipMapped::kYes == cachedProxy->mipMapped())) { diff --git a/src/gpu/ccpr/GrCCPRCoverageOp.cpp b/src/gpu/ccpr/GrCCPRCoverageOp.cpp index 5cd35cd2c6..76e3ddc2b9 100644 --- a/src/gpu/ccpr/GrCCPRCoverageOp.cpp +++ b/src/gpu/ccpr/GrCCPRCoverageOp.cpp @@ -269,11 +269,11 @@ bool GrCCPRCoverageOpsBuilder::finalize(GrOnFlushResourceProvider* onFlushRP, SkASSERT(cubicInstanceData); PathInfo* currPathInfo = fPathsInfo.begin(); - float atlasOffsetX, atlasOffsetY; + float atlasOffsetX = 0.0, atlasOffsetY = 0.0; Sk2f atlasOffset; int ptsIdx = -1; PrimitiveTallies instanceIndices[2] = {baseInstances[0], baseInstances[1]}; - PrimitiveTallies* currIndices; + PrimitiveTallies* currIndices = nullptr; SkSTArray<256, int32_t, true> currFan; #ifdef SK_DEBUG diff --git a/src/gpu/ops/GrMSAAPathRenderer.cpp b/src/gpu/ops/GrMSAAPathRenderer.cpp index cc0e56d0ad..842d710269 100644 --- a/src/gpu/ops/GrMSAAPathRenderer.cpp +++ b/src/gpu/ops/GrMSAAPathRenderer.cpp @@ -368,7 +368,7 @@ private: SkDEBUGCODE(quads.verticesEnd = quads.vertices + fMaxQuadVertices;) const GrBuffer* lineIndexBuffer = nullptr; - int firstLineIndex; + int firstLineIndex = 0; if (fIsIndexed) { lines.indices = target->makeIndexSpace(3 * fMaxLineVertices, &lineIndexBuffer, &firstLineIndex); diff --git a/src/gpu/vk/GrVkPipeline.cpp b/src/gpu/vk/GrVkPipeline.cpp index a247078f72..b1c8dbeeb4 100644 --- a/src/gpu/vk/GrVkPipeline.cpp +++ b/src/gpu/vk/GrVkPipeline.cpp @@ -57,7 +57,7 @@ static void setup_vertex_input_state(const GrPrimitiveProcessor& primProc, VkPipelineVertexInputStateCreateInfo* vertexInputInfo, SkSTArray<2, VkVertexInputBindingDescription, true>* bindingDescs, VkVertexInputAttributeDescription* attributeDesc) { - uint32_t vertexBinding, instanceBinding; + uint32_t vertexBinding = 0, instanceBinding = 0; if (primProc.hasVertexAttribs()) { vertexBinding = bindingDescs->count(); diff --git a/src/opts/SkBlitMask_opts_arm_neon.cpp b/src/opts/SkBlitMask_opts_arm_neon.cpp index ad12369db6..a32392906e 100644 --- a/src/opts/SkBlitMask_opts_arm_neon.cpp +++ b/src/opts/SkBlitMask_opts_arm_neon.cpp @@ -15,18 +15,13 @@ void SkBlitLCD16OpaqueRow_neon(SkPMColor dst[], const uint16_t src[], int colG = SkColorGetG(color); int colB = SkColorGetB(color); - uint8x8_t vcolR, vcolG, vcolB; - uint8x8_t vopqDstA, vopqDstR, vopqDstG, vopqDstB; - - if (width >= 8) { - vcolR = vdup_n_u8(colR); - vcolG = vdup_n_u8(colG); - vcolB = vdup_n_u8(colB); - vopqDstA = vdup_n_u8(SkGetPackedA32(opaqueDst)); - vopqDstR = vdup_n_u8(SkGetPackedR32(opaqueDst)); - vopqDstG = vdup_n_u8(SkGetPackedG32(opaqueDst)); - vopqDstB = vdup_n_u8(SkGetPackedB32(opaqueDst)); - } + uint8x8_t vcolR = vdup_n_u8(colR); + uint8x8_t vcolG = vdup_n_u8(colG); + uint8x8_t vcolB = vdup_n_u8(colB); + uint8x8_t vopqDstA = vdup_n_u8(SkGetPackedA32(opaqueDst)); + uint8x8_t vopqDstR = vdup_n_u8(SkGetPackedR32(opaqueDst)); + uint8x8_t vopqDstG = vdup_n_u8(SkGetPackedG32(opaqueDst)); + uint8x8_t vopqDstB = vdup_n_u8(SkGetPackedB32(opaqueDst)); while (width >= 8) { uint8x8x4_t vdst; @@ -86,15 +81,10 @@ void SkBlitLCD16Row_neon(SkPMColor dst[], const uint16_t src[], colA = SkAlpha255To256(colA); - uint8x8_t vcolR, vcolG, vcolB; - uint16x8_t vcolA; - - if (width >= 8) { - vcolA = vdupq_n_u16(colA); - vcolR = vdup_n_u8(colR); - vcolG = vdup_n_u8(colG); - vcolB = vdup_n_u8(colB); - } + uint16x8_t vcolA = vdupq_n_u16(colA); + uint8x8_t vcolR = vdup_n_u8(colR); + uint8x8_t vcolG = vdup_n_u8(colG); + uint8x8_t vcolB = vdup_n_u8(colB); while (width >= 8) { uint8x8x4_t vdst; diff --git a/src/pathops/SkPathOpsOp.cpp b/src/pathops/SkPathOpsOp.cpp index 54495109f0..dc8808c141 100644 --- a/src/pathops/SkPathOpsOp.cpp +++ b/src/pathops/SkPathOpsOp.cpp @@ -65,7 +65,7 @@ static SkOpSegment* findChaseOp(SkTDArray<SkOpSpanBase*>& chase, SkOpSpanBase** segment = angle->segment(); SkOpSpanBase* start = angle->start(); SkOpSpanBase* end = angle->end(); - int maxWinding, sumWinding, oppMaxWinding, oppSumWinding; + int maxWinding = 0, sumWinding = 0, oppMaxWinding = 0, oppSumWinding = 0; if (sortable) { segment->setUpWindings(start, end, &sumMiWinding, &sumSuWinding, &maxWinding, &sumWinding, &oppMaxWinding, &oppSumWinding); diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp index 4f641aef59..6646384139 100644 --- a/src/ports/SkFontHost_FreeType.cpp +++ b/src/ports/SkFontHost_FreeType.cpp @@ -1294,7 +1294,7 @@ void SkScalerContext_FreeType::generateFontMetrics(SkPaint::FontMetrics* metrics SkScalar x_height = 0.0f; SkScalar avgCharWidth = 0.0f; SkScalar cap_height = 0.0f; - SkScalar strikeoutThickness, strikeoutPosition; + SkScalar strikeoutThickness = 0.0f, strikeoutPosition = 0.0f; TT_OS2* os2 = (TT_OS2*) FT_Get_Sfnt_Table(face, ft_sfnt_os2); if (os2) { x_height = SkIntToScalar(os2->sxHeight) / upem * fScale.y(); diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp index ef17ca8af5..64fcfa4f6c 100644 --- a/src/ports/SkFontHost_win.cpp +++ b/src/ports/SkFontHost_win.cpp @@ -2050,7 +2050,7 @@ int LogFontTypeface::onCharsToGlyphs(const void* chars, Encoding encoding, WCHAR scratch[scratchCount]; int glyphIndex = 0; const char* currentUtf8 = reinterpret_cast<const char*>(chars); - SkUnichar currentChar; + SkUnichar currentChar = 0; if (glyphCount) { currentChar = SkUTF8_NextUnichar(¤tUtf8); } |