diff options
-rw-r--r-- | skia/ext/image_operations.cc | 4 | ||||
-rw-r--r-- | skia/ext/image_operations_unittest.cc | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/skia/ext/image_operations.cc b/skia/ext/image_operations.cc index b193ef9..22d262a 100644 --- a/skia/ext/image_operations.cc +++ b/skia/ext/image_operations.cc @@ -415,7 +415,7 @@ SkBitmap ImageOperations::ResizeSubpixel(const SkBitmap& source, uint32* src = src_row; uint32* dst = dst_row; for (int x = 0; x < dest_subset.width(); x++, src += w, dst++) { - uint8 r, g, b, a; + uint8 r = 0, g = 0, b = 0, a = 0; switch (order) { case SkFontHost::kRGB_LCDOrder: switch (orientation) { @@ -449,6 +449,8 @@ SkBitmap ImageOperations::ResizeSubpixel(const SkBitmap& source, break; } break; + case SkFontHost::kNONE_LCDOrder: + NOTREACHED(); } // Premultiplied alpha is very fragile. a = a > r ? a : r; diff --git a/skia/ext/image_operations_unittest.cc b/skia/ext/image_operations_unittest.cc index d25752f..f81363c 100644 --- a/skia/ext/image_operations_unittest.cc +++ b/skia/ext/image_operations_unittest.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. @@ -7,6 +7,7 @@ #include <vector> #include "base/basictypes.h" +#include "base/compiler_specific.h" #include "base/file_util.h" #include "base/string_util.h" #include "skia/ext/image_operations.h" @@ -537,7 +538,7 @@ TEST(ImageOperations, ResizeShouldAverageColors) { // For each method, downscale by 16 in each dimension, // and check each tested pixel against the expected average color. - bool all_methods_ok = true; + bool all_methods_ok ALLOW_UNUSED = true; for (size_t method_index = 0; method_index < arraysize(tested_methods); |