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

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

Issue 1088093003: Return cropBitmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 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 | « src/images/SkImageDecoder_libjpeg.cpp ('k') | 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 * 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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 return false; 388 return false;
389 } 389 }
390 390
391 // Decode the WebP image data stream using WebP incremental decoding for 391 // Decode the WebP image data stream using WebP incremental decoding for
392 // the specified cropped image-region. 392 // the specified cropped image-region.
393 if (!webp_idecode(this->fInputStream, &config)) { 393 if (!webp_idecode(this->fInputStream, &config)) {
394 return false; 394 return false;
395 } 395 }
396 396
397 if (!directDecode) { 397 if (!directDecode) {
398 cropBitmap(decodedBitmap, bitmap, sampleSize, region.x(), region.y(), 398 return cropBitmap(decodedBitmap, bitmap, sampleSize, region.x(), region. y(),
399 region.width(), region.height(), rect.x(), rect.y()); 399 region.width(), region.height(), rect.x(), rect.y());
400 } 400 }
401 return true; 401 return true;
402 } 402 }
403 403
404 SkImageDecoder::Result SkWEBPImageDecoder::onDecode(SkStream* stream, SkBitmap* decodedBitmap, 404 SkImageDecoder::Result SkWEBPImageDecoder::onDecode(SkStream* stream, SkBitmap* decodedBitmap,
405 Mode mode) { 405 Mode mode) {
406 #ifdef TIME_DECODE 406 #ifdef TIME_DECODE
407 AutoTimeMillis atm("WEBP Decode"); 407 AutoTimeMillis atm("WEBP Decode");
408 #endif 408 #endif
409 409
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 return SkImageDecoder::kUnknown_Format; 668 return SkImageDecoder::kUnknown_Format;
669 } 669 }
670 670
671 static SkImageEncoder* sk_libwebp_efactory(SkImageEncoder::Type t) { 671 static SkImageEncoder* sk_libwebp_efactory(SkImageEncoder::Type t) {
672 return (SkImageEncoder::kWEBP_Type == t) ? SkNEW(SkWEBPImageEncoder) : NUL L; 672 return (SkImageEncoder::kWEBP_Type == t) ? SkNEW(SkWEBPImageEncoder) : NUL L;
673 } 673 }
674 674
675 static SkImageDecoder_DecodeReg gDReg(sk_libwebp_dfactory); 675 static SkImageDecoder_DecodeReg gDReg(sk_libwebp_dfactory);
676 static SkImageDecoder_FormatReg gFormatReg(get_format_webp); 676 static SkImageDecoder_FormatReg gFormatReg(get_format_webp);
677 static SkImageEncoder_EncodeReg gEReg(sk_libwebp_efactory); 677 static SkImageEncoder_EncodeReg gEReg(sk_libwebp_efactory);
OLDNEW
« no previous file with comments | « src/images/SkImageDecoder_libjpeg.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698