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

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

Issue 32653002: scope ComputeIsOpaque with SkBitmap (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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
« no previous file with comments | « no previous file | 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 /* 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 #include "SkTypes.h" 9 #include "SkTypes.h"
10 10
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 bm->eraseColor(SK_ColorTRANSPARENT); 233 bm->eraseColor(SK_ColorTRANSPARENT);
234 const UINT stride = (UINT) bm->rowBytes(); 234 const UINT stride = (UINT) bm->rowBytes();
235 hr = piBitmapSourceConverted->CopyPixels( 235 hr = piBitmapSourceConverted->CopyPixels(
236 NULL, //Get all the pixels 236 NULL, //Get all the pixels
237 stride, 237 stride,
238 stride * height, 238 stride * height,
239 reinterpret_cast<BYTE *>(bm->getPixels()) 239 reinterpret_cast<BYTE *>(bm->getPixels())
240 ); 240 );
241 241
242 // Note: we don't need to premultiply here since we specified PBGRA 242 // Note: we don't need to premultiply here since we specified PBGRA
243 if (ComputeIsOpaque(*bm)) { 243 if (SkBitmap::ComputeIsOpaque(*bm)) {
244 bm->setAlphaType(kOpaque_SkAlphaType); 244 bm->setAlphaType(kOpaque_SkAlphaType);
245 } 245 }
246 } 246 }
247 247
248 return SUCCEEDED(hr); 248 return SUCCEEDED(hr);
249 } 249 }
250 250
251 ///////////////////////////////////////////////////////////////////////// 251 /////////////////////////////////////////////////////////////////////////
252 252
253 extern SkImageDecoder* image_decoder_from_stream(SkStreamRewindable*); 253 extern SkImageDecoder* image_decoder_from_stream(SkStreamRewindable*);
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 static SkImageDecoder::Format get_format_wic(SkStreamRewindable* stream) { 455 static SkImageDecoder::Format get_format_wic(SkStreamRewindable* stream) {
456 SkImageDecoder::Format format; 456 SkImageDecoder::Format format;
457 SkImageDecoder_WIC codec; 457 SkImageDecoder_WIC codec;
458 if (!codec.decodeStream(stream, NULL, SkImageDecoder_WIC::kDecodeFormat_WICM ode, &format)) { 458 if (!codec.decodeStream(stream, NULL, SkImageDecoder_WIC::kDecodeFormat_WICM ode, &format)) {
459 format = SkImageDecoder::kUnknown_Format; 459 format = SkImageDecoder::kUnknown_Format;
460 } 460 }
461 return format; 461 return format;
462 } 462 }
463 463
464 static SkImageDecoder_FormatReg gFormatReg(get_format_wic); 464 static SkImageDecoder_FormatReg gFormatReg(get_format_wic);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698