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

Side by Side Diff: third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.h

Issue 2495183002: Pull up initFrameBuffer to ImageDecoder. (Closed)
Patch Set: Solved merge conflict with crrev.com/2494363002 Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 size_t dataSize, 63 size_t dataSize,
64 size_t frameIndex); 64 size_t frameIndex);
65 65
66 WebPIDecoder* m_decoder; 66 WebPIDecoder* m_decoder;
67 WebPDecBuffer m_decoderBuffer; 67 WebPDecBuffer m_decoderBuffer;
68 int m_formatFlags; 68 int m_formatFlags;
69 bool m_frameBackgroundHasAlpha; 69 bool m_frameBackgroundHasAlpha;
70 70
71 void readColorProfile(); 71 void readColorProfile();
72 bool updateDemuxer(); 72 bool updateDemuxer();
73 bool initFrameBuffer(size_t frameIndex); 73
74 // Set |m_frameBackgroundHasAlpha| based on this frame's characteristics.
75 // Before calling this method, the caller must verify that the frame exists.
76 void onInitFrameBuffer(size_t frameIndex) override;
77
78 // When the blending method of this frame is BlendAtopPreviousFrame, the
79 // previous frame's buffer is necessary to decode this frame in
80 // applyPostProcessing, so we can't take over the data. Before calling this
81 // method, the caller must verify that the frame exists.
82 bool canReusePreviousFrameBuffer(size_t frameIndex) const override;
83
74 void applyPostProcessing(size_t frameIndex); 84 void applyPostProcessing(size_t frameIndex);
75 void clearFrameBuffer(size_t frameIndex) override; 85 void clearFrameBuffer(size_t frameIndex) override;
76 86
77 WebPDemuxer* m_demux; 87 WebPDemuxer* m_demux;
78 WebPDemuxState m_demuxState; 88 WebPDemuxState m_demuxState;
79 bool m_haveAlreadyParsedThisData; 89 bool m_haveAlreadyParsedThisData;
80 int m_repetitionCount; 90 int m_repetitionCount;
81 int m_decodedHeight; 91 int m_decodedHeight;
82 92
83 typedef void (*AlphaBlendFunction)(ImageFrame&, ImageFrame&, int, int, int); 93 typedef void (*AlphaBlendFunction)(ImageFrame&, ImageFrame&, int, int, int);
84 AlphaBlendFunction m_blendFunction; 94 AlphaBlendFunction m_blendFunction;
85 95
86 void clear(); 96 void clear();
87 void clearDecoder(); 97 void clearDecoder();
88 98
89 // FIXME: Update libwebp's API so it does not require copying the data on each 99 // FIXME: Update libwebp's API so it does not require copying the data on each
90 // update. 100 // update.
91 sk_sp<SkData> m_consolidatedData; 101 sk_sp<SkData> m_consolidatedData;
92 }; 102 };
93 103
94 } // namespace blink 104 } // namespace blink
95 105
96 #endif 106 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698