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

Side by Side Diff: src/images/SkImageDecoder_libwebp.cpp

Issue 301283003: Revert "Revert of setConfig -> setInfo (https://codereview.chromium.org/308683005/)" (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add guard for android Created 6 years, 6 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 | « src/image/SkSurface_Raster.cpp ('k') | src/images/SkImageRef.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 2010, The Android Open Source Project 2 * Copyright 2010, The Android Open Source Project
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at 6 * You may obtain a copy of the License at
7 * 7 *
8 * http://www.apache.org/licenses/LICENSE-2.0 8 * http://www.apache.org/licenses/LICENSE-2.0
9 * 9 *
10 * Unless required by applicable law or agreed to in writing, software 10 * Unless required by applicable law or agreed to in writing, software
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 info.fColorType = SkBitmapConfigToColorType(config); 304 info.fColorType = SkBitmapConfigToColorType(config);
305 if (SkToBool(fHasAlpha)) { 305 if (SkToBool(fHasAlpha)) {
306 if (this->getRequireUnpremultipliedColors()) { 306 if (this->getRequireUnpremultipliedColors()) {
307 info.fAlphaType = kUnpremul_SkAlphaType; 307 info.fAlphaType = kUnpremul_SkAlphaType;
308 } else { 308 } else {
309 info.fAlphaType = kPremul_SkAlphaType; 309 info.fAlphaType = kPremul_SkAlphaType;
310 } 310 }
311 } else { 311 } else {
312 info.fAlphaType = kOpaque_SkAlphaType; 312 info.fAlphaType = kOpaque_SkAlphaType;
313 } 313 }
314 return decodedBitmap->setConfig(info); 314 return decodedBitmap->setInfo(info);
315 } 315 }
316 316
317 bool SkWEBPImageDecoder::onBuildTileIndex(SkStreamRewindable* stream, 317 bool SkWEBPImageDecoder::onBuildTileIndex(SkStreamRewindable* stream,
318 int *width, int *height) { 318 int *width, int *height) {
319 int origWidth, origHeight, hasAlpha; 319 int origWidth, origHeight, hasAlpha;
320 if (!webp_parse_header(stream, &origWidth, &origHeight, &hasAlpha)) { 320 if (!webp_parse_header(stream, &origWidth, &origHeight, &hasAlpha)) {
321 return false; 321 return false;
322 } 322 }
323 323
324 if (!stream->rewind()) { 324 if (!stream->rewind()) {
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 return SkImageDecoder::kUnknown_Format; 686 return SkImageDecoder::kUnknown_Format;
687 } 687 }
688 688
689 static SkImageEncoder* sk_libwebp_efactory(SkImageEncoder::Type t) { 689 static SkImageEncoder* sk_libwebp_efactory(SkImageEncoder::Type t) {
690 return (SkImageEncoder::kWEBP_Type == t) ? SkNEW(SkWEBPImageEncoder) : NUL L; 690 return (SkImageEncoder::kWEBP_Type == t) ? SkNEW(SkWEBPImageEncoder) : NUL L;
691 } 691 }
692 692
693 static SkImageDecoder_DecodeReg gDReg(sk_libwebp_dfactory); 693 static SkImageDecoder_DecodeReg gDReg(sk_libwebp_dfactory);
694 static SkImageDecoder_FormatReg gFormatReg(get_format_webp); 694 static SkImageDecoder_FormatReg gFormatReg(get_format_webp);
695 static SkImageEncoder_EncodeReg gEReg(sk_libwebp_efactory); 695 static SkImageEncoder_EncodeReg gEReg(sk_libwebp_efactory);
OLDNEW
« no previous file with comments | « src/image/SkSurface_Raster.cpp ('k') | src/images/SkImageRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698