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

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

Issue 51033004: add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers a warning (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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/images/SkImageDecoder.cpp ('k') | src/images/SkImageEncoder_argb.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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 class SkWEBPImageEncoder : public SkImageEncoder { 514 class SkWEBPImageEncoder : public SkImageEncoder {
515 protected: 515 protected:
516 virtual bool onEncode(SkWStream* stream, const SkBitmap& bm, int quality) SK _OVERRIDE; 516 virtual bool onEncode(SkWStream* stream, const SkBitmap& bm, int quality) SK _OVERRIDE;
517 517
518 private: 518 private:
519 typedef SkImageEncoder INHERITED; 519 typedef SkImageEncoder INHERITED;
520 }; 520 };
521 521
522 bool SkWEBPImageEncoder::onEncode(SkWStream* stream, const SkBitmap& bm, 522 bool SkWEBPImageEncoder::onEncode(SkWStream* stream, const SkBitmap& bm,
523 int quality) { 523 int quality) {
524 const SkBitmap::Config config = bm.getConfig(); 524 const SkBitmap::Config config = bm.config();
525 const ScanlineImporter scanline_import = ChooseImporter(config); 525 const ScanlineImporter scanline_import = ChooseImporter(config);
526 if (NULL == scanline_import) { 526 if (NULL == scanline_import) {
527 return false; 527 return false;
528 } 528 }
529 529
530 SkAutoLockPixels alp(bm); 530 SkAutoLockPixels alp(bm);
531 SkAutoLockColors ctLocker; 531 SkAutoLockColors ctLocker;
532 if (NULL == bm.getPixels()) { 532 if (NULL == bm.getPixels()) {
533 return false; 533 return false;
534 } 534 }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 return SkImageDecoder::kUnknown_Format; 590 return SkImageDecoder::kUnknown_Format;
591 } 591 }
592 592
593 static SkImageEncoder* sk_libwebp_efactory(SkImageEncoder::Type t) { 593 static SkImageEncoder* sk_libwebp_efactory(SkImageEncoder::Type t) {
594 return (SkImageEncoder::kWEBP_Type == t) ? SkNEW(SkWEBPImageEncoder) : NUL L; 594 return (SkImageEncoder::kWEBP_Type == t) ? SkNEW(SkWEBPImageEncoder) : NUL L;
595 } 595 }
596 596
597 static SkImageDecoder_DecodeReg gDReg(sk_libwebp_dfactory); 597 static SkImageDecoder_DecodeReg gDReg(sk_libwebp_dfactory);
598 static SkImageDecoder_FormatReg gFormatReg(get_format_webp); 598 static SkImageDecoder_FormatReg gFormatReg(get_format_webp);
599 static SkImageEncoder_EncodeReg gEReg(sk_libwebp_efactory); 599 static SkImageEncoder_EncodeReg gEReg(sk_libwebp_efactory);
OLDNEW
« no previous file with comments | « src/images/SkImageDecoder.cpp ('k') | src/images/SkImageEncoder_argb.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698