Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Side by Side Diff: tools/android/SkBitmapRegionDecoder.h

Issue 1420053010: Make BRD take advantage of zero initialized memory (Closed) Base URL: https://skia.googlesource.com/skia.git@zero-init
Patch Set: Reduce scope of local variable Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/android/SkBitmapRegionCodec.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkBitmapRegionDecoder_DEFINED 8 #ifndef SkBitmapRegionDecoder_DEFINED
9 #define SkBitmapRegionDecoder_DEFINED 9 #define SkBitmapRegionDecoder_DEFINED
10 10
11 #include "SkBitmap.h" 11 #include "SkBitmap.h"
12 #include "SkBRDAllocator.h"
12 #include "SkEncodedFormat.h" 13 #include "SkEncodedFormat.h"
13 #include "SkStream.h" 14 #include "SkStream.h"
14 15
15 /* 16 /*
16 * This class aims to provide an interface to test multiple implementations of 17 * This class aims to provide an interface to test multiple implementations of
17 * SkBitmapRegionDecoder. 18 * SkBitmapRegionDecoder.
18 */ 19 */
19 class SkBitmapRegionDecoder { 20 class SkBitmapRegionDecoder {
20 public: 21 public:
21 22
(...skipping 29 matching lines...) Expand all
51 * @param sampleSize An integer downscaling factor for the decode. 52 * @param sampleSize An integer downscaling factor for the decode.
52 * @param colorType Preferred output colorType. 53 * @param colorType Preferred output colorType.
53 * New implementations should return NULL if they do not support 54 * New implementations should return NULL if they do not support
54 * decoding to this color type. 55 * decoding to this color type.
55 * The old kOriginal_Strategy will decode to a defaul t color type 56 * The old kOriginal_Strategy will decode to a defaul t color type
56 * if this color type is unsupported. 57 * if this color type is unsupported.
57 * @param requireUnpremul If the image is not opaque, we will use this to de termine the 58 * @param requireUnpremul If the image is not opaque, we will use this to de termine the
58 * alpha type to use. 59 * alpha type to use.
59 * 60 *
60 */ 61 */
61 virtual bool decodeRegion(SkBitmap* bitmap, SkBitmap::Allocator* allocator, 62 virtual bool decodeRegion(SkBitmap* bitmap, SkBRDAllocator* allocator,
62 const SkIRect& desiredSubset, int sampleSize, 63 const SkIRect& desiredSubset, int sampleSize,
63 SkColorType colorType, bool requireUnpremul) = 0; 64 SkColorType colorType, bool requireUnpremul) = 0;
64 /* 65 /*
65 * @param Requested destination color type 66 * @param Requested destination color type
66 * @return true if we support the requested color type and false otherwise 67 * @return true if we support the requested color type and false otherwise
67 */ 68 */
68 virtual bool conversionSupported(SkColorType colorType) = 0; 69 virtual bool conversionSupported(SkColorType colorType) = 0;
69 70
70 virtual SkEncodedFormat getEncodedFormat() = 0; 71 virtual SkEncodedFormat getEncodedFormat() = 0;
71 72
72 int width() const { return fWidth; } 73 int width() const { return fWidth; }
73 int height() const { return fHeight; } 74 int height() const { return fHeight; }
74 75
75 virtual ~SkBitmapRegionDecoder() {} 76 virtual ~SkBitmapRegionDecoder() {}
76 77
77 protected: 78 protected:
78 79
79 SkBitmapRegionDecoder(int width, int height) 80 SkBitmapRegionDecoder(int width, int height)
80 : fWidth(width) 81 : fWidth(width)
81 , fHeight(height) 82 , fHeight(height)
82 {} 83 {}
83 84
84 private: 85 private:
85 const int fWidth; 86 const int fWidth;
86 const int fHeight; 87 const int fHeight;
87 }; 88 };
88 89
89 #endif 90 #endif
OLDNEW
« no previous file with comments | « tools/android/SkBitmapRegionCodec.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698