| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2007 The Android Open Source Project | 3 * Copyright 2007 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #include "bmpdecoderhelper.h" | 10 #include "bmpdecoderhelper.h" |
| 11 #include "SkColorPriv.h" | 11 #include "SkColorPriv.h" |
| 12 #include "SkImageDecoder.h" | 12 #include "SkImageDecoder.h" |
| 13 #include "SkScaledBitmapSampler.h" | 13 #include "SkScaledBitmapSampler.h" |
| 14 #include "SkStream.h" | 14 #include "SkStream.h" |
| 15 #include "SkStreamPriv.h" | 15 #include "SkStreamPriv.h" |
| 16 #include "SkTDArray.h" | 16 #include "SkTDArray.h" |
| 17 | 17 |
| 18 class SkBMPImageDecoder : public SkImageDecoder { | 18 class SkBMPImageDecoder : public SkImageDecoder { |
| 19 public: | 19 public: |
| 20 SkBMPImageDecoder() {} | 20 SkBMPImageDecoder() {} |
| 21 | 21 |
| 22 Format getFormat() const SK_OVERRIDE { | 22 Format getFormat() const override { |
| 23 return kBMP_Format; | 23 return kBMP_Format; |
| 24 } | 24 } |
| 25 | 25 |
| 26 protected: | 26 protected: |
| 27 Result onDecode(SkStream* stream, SkBitmap* bm, Mode mode) SK_OVERRIDE; | 27 Result onDecode(SkStream* stream, SkBitmap* bm, Mode mode) override; |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 typedef SkImageDecoder INHERITED; | 30 typedef SkImageDecoder INHERITED; |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 /////////////////////////////////////////////////////////////////////////////// | 33 /////////////////////////////////////////////////////////////////////////////// |
| 34 DEFINE_DECODER_CREATOR(BMPImageDecoder); | 34 DEFINE_DECODER_CREATOR(BMPImageDecoder); |
| 35 /////////////////////////////////////////////////////////////////////////////// | 35 /////////////////////////////////////////////////////////////////////////////// |
| 36 | 36 |
| 37 static bool is_bmp(SkStreamRewindable* stream) { | 37 static bool is_bmp(SkStreamRewindable* stream) { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 const int dstHeight = sampler.scaledHeight(); | 153 const int dstHeight = sampler.scaledHeight(); |
| 154 const uint8_t* srcRow = callback.rgb(); | 154 const uint8_t* srcRow = callback.rgb(); |
| 155 | 155 |
| 156 srcRow += sampler.srcY0() * srcRowBytes; | 156 srcRow += sampler.srcY0() * srcRowBytes; |
| 157 for (int y = 0; y < dstHeight; y++) { | 157 for (int y = 0; y < dstHeight; y++) { |
| 158 sampler.next(srcRow); | 158 sampler.next(srcRow); |
| 159 srcRow += sampler.srcDY() * srcRowBytes; | 159 srcRow += sampler.srcDY() * srcRowBytes; |
| 160 } | 160 } |
| 161 return kSuccess; | 161 return kSuccess; |
| 162 } | 162 } |
| OLD | NEW |