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

Side by Side Diff: src/codec/SkCodec.cpp

Issue 1277213002: Support more swizzles to 565 in SkCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update new 565 swizzling functions for scaling Created 5 years, 4 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
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 #include "SkBmpCodec.h" 8 #include "SkBmpCodec.h"
9 #include "SkCodec.h" 9 #include "SkCodec.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 return kInvalidParameters; 116 return kInvalidParameters;
117 } 117 }
118 } else { 118 } else {
119 if (ctableCount) { 119 if (ctableCount) {
120 *ctableCount = 0; 120 *ctableCount = 0;
121 } 121 }
122 ctableCount = NULL; 122 ctableCount = NULL;
123 ctable = NULL; 123 ctable = NULL;
124 } 124 }
125 125
126 {
127 SkAlphaType canonical;
128 if (!SkColorTypeValidateAlphaType(info.colorType(), info.alphaType(), &c anonical)
129 || canonical != info.alphaType())
130 {
131 return kInvalidConversion;
132 }
133 }
134
126 // Default options. 135 // Default options.
127 Options optsStorage; 136 Options optsStorage;
128 if (NULL == options) { 137 if (NULL == options) {
129 options = &optsStorage; 138 options = &optsStorage;
130 } 139 }
131 const Result result = this->onGetPixels(info, pixels, rowBytes, *options, ct able, ctableCount); 140 const Result result = this->onGetPixels(info, pixels, rowBytes, *options, ct able, ctableCount);
132 141
133 if ((kIncompleteInput == result || kSuccess == result) && ctableCount) { 142 if ((kIncompleteInput == result || kSuccess == result) && ctableCount) {
134 SkASSERT(*ctableCount >= 0 && *ctableCount <= 256); 143 SkASSERT(*ctableCount >= 0 && *ctableCount <= 256);
135 } 144 }
136 return result; 145 return result;
137 } 146 }
138 147
139 SkCodec::Result SkCodec::getPixels(const SkImageInfo& info, void* pixels, size_t rowBytes) { 148 SkCodec::Result SkCodec::getPixels(const SkImageInfo& info, void* pixels, size_t rowBytes) {
140 return this->getPixels(info, pixels, rowBytes, NULL, NULL, NULL); 149 return this->getPixels(info, pixels, rowBytes, NULL, NULL, NULL);
141 } 150 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698