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

Side by Side Diff: src/ports/SkImageDecoder_WIC.cpp

Issue 25275004: store SkAlphaType inside SkBitmap, on road to support unpremul (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: remove occurances of setIsOpaque Created 7 years, 2 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 | Annotate | Revision Log
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
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 #define WIN32_LEAN_AND_MEAN 10 #define WIN32_LEAN_AND_MEAN
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 bm->eraseColor(SK_ColorTRANSPARENT); 215 bm->eraseColor(SK_ColorTRANSPARENT);
216 const UINT stride = bm->rowBytes(); 216 const UINT stride = bm->rowBytes();
217 hr = piBitmapSourceConverted->CopyPixels( 217 hr = piBitmapSourceConverted->CopyPixels(
218 NULL, //Get all the pixels 218 NULL, //Get all the pixels
219 stride, 219 stride,
220 stride * height, 220 stride * height,
221 reinterpret_cast<BYTE *>(bm->getPixels()) 221 reinterpret_cast<BYTE *>(bm->getPixels())
222 ); 222 );
223 223
224 // Note: we don't need to premultiply here since we specified PBGRA 224 // Note: we don't need to premultiply here since we specified PBGRA
225 bm->computeAndSetOpaquePredicate(); 225 if (ComputeIsOpaque(*bm)) {
226 bm->setAlphaType(kOpaque_SkAlphaType);
227 }
226 } 228 }
227 229
228 return SUCCEEDED(hr); 230 return SUCCEEDED(hr);
229 } 231 }
230 232
231 ///////////////////////////////////////////////////////////////////////// 233 /////////////////////////////////////////////////////////////////////////
232 234
233 extern SkImageDecoder* image_decoder_from_stream(SkStreamRewindable*); 235 extern SkImageDecoder* image_decoder_from_stream(SkStreamRewindable*);
234 236
235 SkImageDecoder* SkImageDecoder::Factory(SkStreamRewindable* stream) { 237 SkImageDecoder* SkImageDecoder::Factory(SkStreamRewindable* stream) {
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 static SkImageDecoder::Format get_format_wic(SkStreamRewindable* stream) { 437 static SkImageDecoder::Format get_format_wic(SkStreamRewindable* stream) {
436 SkImageDecoder::Format format; 438 SkImageDecoder::Format format;
437 SkImageDecoder_WIC codec; 439 SkImageDecoder_WIC codec;
438 if (!codec.decodeStream(stream, NULL, SkImageDecoder_WIC::kDecodeFormat_WICM ode, &format)) { 440 if (!codec.decodeStream(stream, NULL, SkImageDecoder_WIC::kDecodeFormat_WICM ode, &format)) {
439 format = SkImageDecoder::kUnknown_Format; 441 format = SkImageDecoder::kUnknown_Format;
440 } 442 }
441 return format; 443 return format;
442 } 444 }
443 445
444 static SkImageDecoder_FormatReg gFormatReg(get_format_wic); 446 static SkImageDecoder_FormatReg gFormatReg(get_format_wic);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698