diff options
author | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-03 21:00:02 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-03 21:00:02 +0000 |
commit | 61076179916109d927541bd93cf888a7f858f645 (patch) | |
tree | a69b6fbff25bf30950be14a877900d0bc78ec679 /skia | |
parent | ee0c66a87aeb76b5abc53278fabeb1403c860f46 (diff) | |
download | chromium_src-61076179916109d927541bd93cf888a7f858f645.zip chromium_src-61076179916109d927541bd93cf888a7f858f645.tar.gz chromium_src-61076179916109d927541bd93cf888a7f858f645.tar.bz2 |
Fix Coverity defects in skia/ext:
- Three uninit ctors, two dead codes, and a misuse of var args.
CID=100083, 101537, 17746, 9369, 9279, 9278
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/8965060
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116189 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia')
-rw-r--r-- | skia/ext/bitmap_platform_device_linux.cc | 5 | ||||
-rw-r--r-- | skia/ext/bitmap_platform_device_mac.cc | 6 | ||||
-rw-r--r-- | skia/ext/bitmap_platform_device_win.cc | 7 | ||||
-rw-r--r-- | skia/ext/google_logging.cc | 3 | ||||
-rw-r--r-- | skia/ext/image_operations.cc | 12 | ||||
-rw-r--r-- | skia/ext/platform_device_win.cc | 3 | ||||
-rw-r--r-- | skia/ext/vector_platform_device_emf_win.cc | 9 |
7 files changed, 20 insertions, 25 deletions
diff --git a/skia/ext/bitmap_platform_device_linux.cc b/skia/ext/bitmap_platform_device_linux.cc index c95f3a9..4145b26 100644 --- a/skia/ext/bitmap_platform_device_linux.cc +++ b/skia/ext/bitmap_platform_device_linux.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -44,7 +44,8 @@ void LoadClipToContext(cairo_t* context, const SkRegion& clip) { BitmapPlatformDevice::BitmapPlatformDeviceData::BitmapPlatformDeviceData( cairo_surface_t* surface) : surface_(surface), - config_dirty_(true) { // Want to load the config next time. + config_dirty_(true), + transform_(SkMatrix::I()) { // Want to load the config next time. bitmap_context_ = cairo_create(surface); } diff --git a/skia/ext/bitmap_platform_device_mac.cc b/skia/ext/bitmap_platform_device_mac.cc index 2c274c3..6c4043d 100644 --- a/skia/ext/bitmap_platform_device_mac.cc +++ b/skia/ext/bitmap_platform_device_mac.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -53,7 +53,8 @@ static CGContextRef CGContextForData(void* data, int width, int height) { BitmapPlatformDevice::BitmapPlatformDeviceData::BitmapPlatformDeviceData( CGContextRef bitmap) : bitmap_context_(bitmap), - config_dirty_(true) { // Want to load the config next time. + config_dirty_(true), // Want to load the config next time. + transform_(SkMatrix::I()) { SkASSERT(bitmap_context_); // Initialize the clip region to the entire bitmap. @@ -62,7 +63,6 @@ BitmapPlatformDevice::BitmapPlatformDeviceData::BitmapPlatformDeviceData( CGBitmapContextGetWidth(bitmap_context_), CGBitmapContextGetHeight(bitmap_context_)); clip_region_ = SkRegion(rect); - transform_.reset(); CGContextRetain(bitmap_context_); // We must save the state once so that we can use the restore/save trick // in LoadConfig(). diff --git a/skia/ext/bitmap_platform_device_win.cc b/skia/ext/bitmap_platform_device_win.cc index 3a2a5b4..3c39f10 100644 --- a/skia/ext/bitmap_platform_device_win.cc +++ b/skia/ext/bitmap_platform_device_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -19,7 +19,8 @@ BitmapPlatformDevice::BitmapPlatformDeviceData::BitmapPlatformDeviceData( HBITMAP hbitmap) : bitmap_context_(hbitmap), hdc_(NULL), - config_dirty_(true) { // Want to load the config next time. + config_dirty_(true), // Want to load the config next time. + transform_(SkMatrix::I()) { // Initialize the clip region to the entire bitmap. BITMAP bitmap_data; if (GetObject(bitmap_context_, sizeof(BITMAP), &bitmap_data)) { @@ -27,8 +28,6 @@ BitmapPlatformDevice::BitmapPlatformDeviceData::BitmapPlatformDeviceData( rect.set(0, 0, bitmap_data.bmWidth, bitmap_data.bmHeight); clip_region_ = SkRegion(rect); } - - transform_.reset(); } BitmapPlatformDevice::BitmapPlatformDeviceData::~BitmapPlatformDeviceData() { diff --git a/skia/ext/google_logging.cc b/skia/ext/google_logging.cc index b9d8b3a..5e8ffe1 100644 --- a/skia/ext/google_logging.cc +++ b/skia/ext/google_logging.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -17,6 +17,7 @@ void SkDebugf_FileLine(const char* file, int line, bool fatal, std::string msg; base::StringAppendV(&msg, format, ap); + va_end(ap); logging::LogMessage(file, line, fatal ? logging::LOG_FATAL : logging::LOG_INFO).stream() diff --git a/skia/ext/image_operations.cc b/skia/ext/image_operations.cc index 7808370..b193ef9 100644 --- a/skia/ext/image_operations.cc +++ b/skia/ext/image_operations.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -99,10 +99,6 @@ class ResizeFilter { int dest_width, int dest_height, const SkIRect& dest_subset); - // Returns the bounds in the input bitmap of data that is used in the output. - // The filter offsets are within this rectangle. - const SkIRect& src_depend() { return src_depend_; } - // Returns the filled filter values. const ConvolutionFilter1D& x_filter() { return x_filter_; } const ConvolutionFilter1D& y_filter() { return y_filter_; } @@ -167,9 +163,6 @@ class ResizeFilter { ImageOperations::ResizeMethod method_; - // Subset of source the filters will touch. - SkIRect src_depend_; - // Size of the filter support on one side only in the destination space. // See GetFilterSupport. float x_filter_support_; @@ -438,9 +431,6 @@ SkBitmap ImageOperations::ResizeSubpixel(const SkBitmap& source, b = SkGetPackedB32(src[2 * row_words]); a = SkGetPackedA32(src[1 * row_words]); break; - default: - NOTREACHED(); - break; } break; case SkFontHost::kBGR_LCDOrder: diff --git a/skia/ext/platform_device_win.cc b/skia/ext/platform_device_win.cc index 100a811..f44e66e 100644 --- a/skia/ext/platform_device_win.cc +++ b/skia/ext/platform_device_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -185,7 +185,6 @@ bool PlatformDevice::SkPathToCubicPaths(CubicPaths* paths, current_path = &paths->back(); continue; } - case SkPath::kDone_Verb: // iter.next returns 0 points default: { current_path = NULL; // Will return false. diff --git a/skia/ext/vector_platform_device_emf_win.cc b/skia/ext/vector_platform_device_emf_win.cc index c754f85..99f7dc8 100644 --- a/skia/ext/vector_platform_device_emf_win.cc +++ b/skia/ext/vector_platform_device_emf_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -295,7 +295,12 @@ static bool gdiCanHandleText(const SkPaint& paint) { class SkGDIFontSetup { public: - SkGDIFontSetup() : fUseGDI(false) { + SkGDIFontSetup() : + fHDC(NULL), + fNewFont(NULL), + fSavedFont(NULL), + fSavedTextColor(0), + fUseGDI(false) { SkDEBUGCODE(fUseGDIHasBeenCalled = false;) } ~SkGDIFontSetup(); |