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

Side by Side Diff: src/codec/SkBmpCodec.h

Issue 1691083002: Implement onSkipScanlines() for bmp and wbmp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 months 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 | « include/codec/SkCodec.h ('k') | src/codec/SkBmpCodec.cpp » ('j') | 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 #ifndef SkBmpCodec_DEFINED 7 #ifndef SkBmpCodec_DEFINED
8 #define SkBmpCodec_DEFINED 8 #define SkBmpCodec_DEFINED
9 9
10 #include "SkCodec.h" 10 #include "SkCodec.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 * when we want to decode the full or one when we are 74 * when we want to decode the full or one when we are
75 * sampling. 75 * sampling.
76 */ 76 */
77 int32_t getDstRow(int32_t y, int32_t height) const; 77 int32_t getDstRow(int32_t y, int32_t height) const;
78 78
79 /* 79 /*
80 * Accessors used by subclasses 80 * Accessors used by subclasses
81 */ 81 */
82 uint16_t bitsPerPixel() const { return fBitsPerPixel; } 82 uint16_t bitsPerPixel() const { return fBitsPerPixel; }
83 SkScanlineOrder onGetScanlineOrder() const override { return fRowOrder; } 83 SkScanlineOrder onGetScanlineOrder() const override { return fRowOrder; }
84 size_t srcRowBytes() const { return fSrcRowBytes; }
84 85
85 /* 86 /*
86 * To be overriden by bmp subclasses, which provide unique implementations. 87 * To be overriden by bmp subclasses, which provide unique implementations.
87 * Performs subclass specific setup. 88 * Performs subclass specific setup.
88 * 89 *
89 * @param dstInfo Contains output information. Height specifies 90 * @param dstInfo Contains output information. Height specifies
90 * the total number of rows that will be decoded. 91 * the total number of rows that will be decoded.
91 * @param options Additonal options to pass to the decoder. 92 * @param options Additonal options to pass to the decoder.
92 * @param inputColorPtr Client-provided memory for a color table. Must 93 * @param inputColorPtr Client-provided memory for a color table. Must
93 * be enough for 256 colors. This will be 94 * be enough for 256 colors. This will be
(...skipping 26 matching lines...) Expand all
120 * 121 *
121 * @param dstInfo Contains output information. Height specifies the 122 * @param dstInfo Contains output information. Height specifies the
122 * number of rows to decode at this time. 123 * number of rows to decode at this time.
123 * @param dst Memory location to store output pixels 124 * @param dst Memory location to store output pixels
124 * @param dstRowBytes Bytes in a row of the destination 125 * @param dstRowBytes Bytes in a row of the destination
125 * @return Number of rows successfully decoded 126 * @return Number of rows successfully decoded
126 */ 127 */
127 virtual int decodeRows(const SkImageInfo& dstInfo, void* dst, size_t dstRowB ytes, 128 virtual int decodeRows(const SkImageInfo& dstInfo, void* dst, size_t dstRowB ytes,
128 const Options& opts) = 0; 129 const Options& opts) = 0;
129 130
131 virtual bool skipRows(int count);
132
130 Result onStartScanlineDecode(const SkImageInfo& dstInfo, const SkCodec::Opti ons&, 133 Result onStartScanlineDecode(const SkImageInfo& dstInfo, const SkCodec::Opti ons&,
131 SkPMColor inputColorPtr[], int* inputColorCount) override; 134 SkPMColor inputColorPtr[], int* inputColorCount) override;
132 135
133 int onGetScanlines(void* dst, int count, size_t rowBytes) override; 136 int onGetScanlines(void* dst, int count, size_t rowBytes) override;
134 137
135 // TODO(msarett): Override default skipping with something more clever. 138 bool onSkipScanlines(int count) override;
136 139
137 const uint16_t fBitsPerPixel; 140 const uint16_t fBitsPerPixel;
138 const SkScanlineOrder fRowOrder; 141 const SkScanlineOrder fRowOrder;
142 const size_t fSrcRowBytes;
139 143
140 typedef SkCodec INHERITED; 144 typedef SkCodec INHERITED;
141 }; 145 };
142 146
143 #endif 147 #endif
OLDNEW
« no previous file with comments | « include/codec/SkCodec.h ('k') | src/codec/SkBmpCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698