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

Side by Side Diff: Source/platform/image-decoders/png/PNGImageDecoder.h

Issue 131003004: Update platform classes to use OVERRIDE / FINAL when needed (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 24 matching lines...) Expand all
35 class PNGImageReader; 35 class PNGImageReader;
36 36
37 // This class decodes the PNG image format. 37 // This class decodes the PNG image format.
38 class PLATFORM_EXPORT PNGImageDecoder : public ImageDecoder { 38 class PLATFORM_EXPORT PNGImageDecoder : public ImageDecoder {
39 WTF_MAKE_NONCOPYABLE(PNGImageDecoder); 39 WTF_MAKE_NONCOPYABLE(PNGImageDecoder);
40 public: 40 public:
41 PNGImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileO ption, size_t maxDecodedBytes); 41 PNGImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileO ption, size_t maxDecodedBytes);
42 virtual ~PNGImageDecoder(); 42 virtual ~PNGImageDecoder();
43 43
44 // ImageDecoder 44 // ImageDecoder
45 virtual String filenameExtension() const { return "png"; } 45 virtual String filenameExtension() const OVERRIDE { return "png"; }
46 virtual bool isSizeAvailable(); 46 virtual bool isSizeAvailable() OVERRIDE;
47 virtual ImageFrame* frameBufferAtIndex(size_t); 47 virtual ImageFrame* frameBufferAtIndex(size_t) OVERRIDE;
48 // CAUTION: setFailed() deletes |m_reader|. Be careful to avoid 48 // CAUTION: setFailed() deletes |m_reader|. Be careful to avoid
49 // accessing deleted memory, especially when calling this from inside 49 // accessing deleted memory, especially when calling this from inside
50 // PNGImageReader! 50 // PNGImageReader!
51 virtual bool setFailed(); 51 virtual bool setFailed() OVERRIDE;
52 52
53 // Callbacks from libpng 53 // Callbacks from libpng
54 void headerAvailable(); 54 void headerAvailable();
55 void rowAvailable(unsigned char* rowBuffer, unsigned rowIndex, int interlace Pass); 55 void rowAvailable(unsigned char* rowBuffer, unsigned rowIndex, int interlace Pass);
56 void pngComplete(); 56 void pngComplete();
57 57
58 bool isComplete() const 58 bool isComplete() const
59 { 59 {
60 return !m_frameBufferCache.isEmpty() && (m_frameBufferCache.first().stat us() == ImageFrame::FrameComplete); 60 return !m_frameBufferCache.isEmpty() && (m_frameBufferCache.first().stat us() == ImageFrame::FrameComplete);
61 } 61 }
62 62
63 private: 63 private:
64 // Decodes the image. If |onlySize| is true, stops decoding after 64 // Decodes the image. If |onlySize| is true, stops decoding after
65 // calculating the image size. If decoding fails but there is no more 65 // calculating the image size. If decoding fails but there is no more
66 // data coming, sets the "decode failure" flag. 66 // data coming, sets the "decode failure" flag.
67 void decode(bool onlySize); 67 void decode(bool onlySize);
68 68
69 OwnPtr<PNGImageReader> m_reader; 69 OwnPtr<PNGImageReader> m_reader;
70 bool m_doNothingOnFailure; 70 bool m_doNothingOnFailure;
71 }; 71 };
72 72
73 } // namespace WebCore 73 } // namespace WebCore
74 74
75 #endif 75 #endif
OLDNEW
« no previous file with comments | « Source/platform/image-decoders/ico/ICOImageDecoder.h ('k') | Source/platform/mac/ScrollAnimatorMac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698