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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/ImageSource.h

Issue 2202473002: DO NOT COMMIT: Experimental removal of encoded image data Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: (rebase) Created 4 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // earlier frame may require more work to be done, e.g. redecoding the image 63 // earlier frame may require more work to be done, e.g. redecoding the image
64 // from the beginning. 64 // from the beginning.
65 // 65 //
66 // Implementations may elect to preserve more frames than the one requested 66 // Implementations may elect to preserve more frames than the one requested
67 // here if doing so is likely to save CPU time in the future, but will pay 67 // here if doing so is likely to save CPU time in the future, but will pay
68 // an increased memory cost to do so. 68 // an increased memory cost to do so.
69 // 69 //
70 // Returns the number of bytes of frame data actually cleared. 70 // Returns the number of bytes of frame data actually cleared.
71 size_t clearCacheExceptFrame(size_t); 71 size_t clearCacheExceptFrame(size_t);
72 72
73 bool clear();
73 PassRefPtr<SharedBuffer> data(); 74 PassRefPtr<SharedBuffer> data();
74 // Returns false when the decoder layer rejects the data. 75 // Returns false when the decoder layer rejects the data.
75 bool setData(PassRefPtr<SharedBuffer> data, bool allDataReceived); 76 bool setData(PassRefPtr<SharedBuffer> data, bool allDataReceived);
76 String filenameExtension() const; 77 String filenameExtension() const;
77 78
78 bool isSizeAvailable(); 79 bool isSizeAvailable();
79 bool hasColorProfile() const; 80 bool hasColorProfile() const;
80 IntSize size(RespectImageOrientationEnum = DoNotRespectImageOrientation) con st; 81 IntSize size(RespectImageOrientationEnum = DoNotRespectImageOrientation) con st;
81 IntSize frameSizeAtIndex(size_t, RespectImageOrientationEnum = DoNotRespectI mageOrientation) const; 82 IntSize frameSizeAtIndex(size_t, RespectImageOrientationEnum = DoNotRespectI mageOrientation) const;
82 83
83 bool getHotSpot(IntPoint&) const; 84 bool getHotSpot(IntPoint&) const;
84 int repetitionCount(); 85 int repetitionCount();
85 86
86 size_t frameCount() const; 87 size_t frameCount() const;
87 88
88 // Attempts to create the requested frame. 89 // Attempts to create the requested frame.
89 sk_sp<SkImage> createFrameAtIndex(size_t); 90 sk_sp<SkImage> createFrameAtIndex(size_t);
90 91
91 float frameDurationAtIndex(size_t) const; 92 float frameDurationAtIndex(size_t) const;
92 bool frameHasAlphaAtIndex(size_t) const; // Whether or not the frame actuall y used any alpha. 93 bool frameHasAlphaAtIndex(size_t) const; // Whether or not the frame actuall y used any alpha.
93 bool frameIsCompleteAtIndex(size_t) const; // Whether or not the frame is fu lly received. 94 bool frameIsCompleteAtIndex(size_t) const; // Whether or not the frame is fu lly received.
94 ImageOrientation orientationAtIndex(size_t) const; // EXIF image orientation 95 ImageOrientation orientationAtIndex(size_t) const; // EXIF image orientation
95 96
96 // Returns the number of bytes in the decoded frame. May return 0 if the 97 // Returns the number of bytes in the decoded frame. May return 0 if the
97 // frame has not yet begun to decode. 98 // frame has not yet begun to decode.
98 size_t frameBytesAtIndex(size_t) const; 99 size_t frameBytesAtIndex(size_t) const;
99 100
101 bool isBufferCleared() const { return m_decoder ? m_decoder->isBufferCleared () : false; }
102
100 private: 103 private:
101 std::unique_ptr<DeferredImageDecoder> m_decoder; 104 std::unique_ptr<DeferredImageDecoder> m_decoder;
102 }; 105 };
103 106
104 } // namespace blink 107 } // namespace blink
105 108
106 #endif 109 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698