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

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

Issue 1925533003: High CPU and increased memory usage fix for high-res (GIF, WEBP...) animations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 * 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 #include "wtf/Forward.h" 35 #include "wtf/Forward.h"
36 #include "wtf/OwnPtr.h" 36 #include "wtf/OwnPtr.h"
37 #include "wtf/Vector.h" 37 #include "wtf/Vector.h"
38 38
39 class SkImage; 39 class SkImage;
40 40
41 namespace blink { 41 namespace blink {
42 42
43 class ImageFrameGenerator; 43 class ImageFrameGenerator;
44 class SharedBuffer; 44 class SharedBuffer;
45 struct FrameData; 45 struct DeferredFrameData;
46 46
47 class PLATFORM_EXPORT DeferredImageDecoder final { 47 class PLATFORM_EXPORT DeferredImageDecoder final {
48 WTF_MAKE_NONCOPYABLE(DeferredImageDecoder); 48 WTF_MAKE_NONCOPYABLE(DeferredImageDecoder);
49 USING_FAST_MALLOC(DeferredImageDecoder); 49 USING_FAST_MALLOC(DeferredImageDecoder);
50 public: 50 public:
51 static PassOwnPtr<DeferredImageDecoder> create(const SharedBuffer& data, Ima geDecoder::AlphaOption, ImageDecoder::GammaAndColorProfileOption); 51 static PassOwnPtr<DeferredImageDecoder> create(const SharedBuffer& data, Ima geDecoder::AlphaOption, ImageDecoder::GammaAndColorProfileOption);
52 52
53 static PassOwnPtr<DeferredImageDecoder> createForTesting(PassOwnPtr<ImageDec oder>); 53 static PassOwnPtr<DeferredImageDecoder> createForTesting(PassOwnPtr<ImageDec oder>);
54 54
55 ~DeferredImageDecoder(); 55 ~DeferredImageDecoder();
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 unsigned m_lastDataSize; 93 unsigned m_lastDataSize;
94 OwnPtr<ImageDecoder> m_actualDecoder; 94 OwnPtr<ImageDecoder> m_actualDecoder;
95 95
96 String m_filenameExtension; 96 String m_filenameExtension;
97 IntSize m_size; 97 IntSize m_size;
98 int m_repetitionCount; 98 int m_repetitionCount;
99 bool m_hasColorProfile; 99 bool m_hasColorProfile;
100 bool m_canYUVDecode; 100 bool m_canYUVDecode;
101 101
102 // Carries only frame state and other information. Does not carry bitmap. 102 // Carries only frame state and other information. Does not carry bitmap.
103 Vector<FrameData> m_frameData; 103 Vector<DeferredFrameData> m_frameData;
104 RefPtr<ImageFrameGenerator> m_frameGenerator; 104 RefPtr<ImageFrameGenerator> m_frameGenerator;
105 105
106 static bool s_enabled; 106 static bool s_enabled;
107 }; 107 };
108 108
109 } // namespace blink 109 } // namespace blink
110 110
111 #endif 111 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698