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

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

Issue 1331533002: [poc] curve-filter Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix CanvasRenderingContext2D::createPattern crash for #40 Created 4 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
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 22 matching lines...) Expand all
33 #include "third_party/skia/include/core/SkPixelRef.h" 33 #include "third_party/skia/include/core/SkPixelRef.h"
34 #include "wtf/Allocator.h" 34 #include "wtf/Allocator.h"
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 ColorSpaceProfile;
43 class ImageFrameGenerator; 44 class ImageFrameGenerator;
44 class SharedBuffer; 45 class SharedBuffer;
45 struct FrameData; 46 struct FrameData;
46 47
47 class PLATFORM_EXPORT DeferredImageDecoder final { 48 class PLATFORM_EXPORT DeferredImageDecoder final {
48 WTF_MAKE_NONCOPYABLE(DeferredImageDecoder); 49 WTF_MAKE_NONCOPYABLE(DeferredImageDecoder);
49 USING_FAST_MALLOC(DeferredImageDecoder); 50 USING_FAST_MALLOC(DeferredImageDecoder);
50 public: 51 public:
51 static PassOwnPtr<DeferredImageDecoder> create(const SharedBuffer& data, Ima geDecoder::AlphaOption, ImageDecoder::GammaAndColorProfileOption); 52 static PassOwnPtr<DeferredImageDecoder> create(const SharedBuffer& data, Ima geDecoder::AlphaOption, ImageDecoder::GammaAndColorProfileOption);
52 53
53 static PassOwnPtr<DeferredImageDecoder> createForTesting(PassOwnPtr<ImageDec oder>); 54 static PassOwnPtr<DeferredImageDecoder> createForTesting(PassOwnPtr<ImageDec oder>);
54 55
55 ~DeferredImageDecoder(); 56 ~DeferredImageDecoder();
56 57
57 static void setEnabled(bool); 58 static void setEnabled(bool);
58 static bool enabled(); 59 static bool enabled();
59 60
60 String filenameExtension() const; 61 String filenameExtension() const;
61 62
62 PassRefPtr<SkImage> createFrameAtIndex(size_t); 63 PassRefPtr<SkImage> createFrameAtIndex(size_t);
63 64
64 void setData(SharedBuffer& data, bool allDataReceived); 65 void setData(SharedBuffer& data, bool allDataReceived);
65 66
66 bool isSizeAvailable(); 67 bool isSizeAvailable();
67 bool hasColorProfile() const; 68 bool hasColorProfile() const;
69 PassRefPtr<ColorSpaceProfile> colorProfile() const;
68 IntSize size() const; 70 IntSize size() const;
69 IntSize frameSizeAtIndex(size_t index) const; 71 IntSize frameSizeAtIndex(size_t index) const;
70 size_t frameCount(); 72 size_t frameCount();
71 int repetitionCount() const; 73 int repetitionCount() const;
72 size_t clearCacheExceptFrame(size_t index); 74 size_t clearCacheExceptFrame(size_t index);
73 bool frameHasAlphaAtIndex(size_t index) const; 75 bool frameHasAlphaAtIndex(size_t index) const;
74 bool frameIsCompleteAtIndex(size_t index) const; 76 bool frameIsCompleteAtIndex(size_t index) const;
75 float frameDurationAtIndex(size_t index) const; 77 float frameDurationAtIndex(size_t index) const;
76 size_t frameBytesAtIndex(size_t index) const; 78 size_t frameBytesAtIndex(size_t index) const;
77 ImageOrientation orientationAtIndex(size_t index) const; 79 ImageOrientation orientationAtIndex(size_t index) const;
(...skipping 11 matching lines...) Expand all
89 PassRefPtr<SkImage> createFrameImageAtIndex(size_t index, bool knownToBeOpaq ue) const; 91 PassRefPtr<SkImage> createFrameImageAtIndex(size_t index, bool knownToBeOpaq ue) const;
90 92
91 RefPtr<SharedBuffer> m_data; 93 RefPtr<SharedBuffer> m_data;
92 bool m_allDataReceived; 94 bool m_allDataReceived;
93 unsigned m_lastDataSize; 95 unsigned m_lastDataSize;
94 OwnPtr<ImageDecoder> m_actualDecoder; 96 OwnPtr<ImageDecoder> m_actualDecoder;
95 97
96 String m_filenameExtension; 98 String m_filenameExtension;
97 IntSize m_size; 99 IntSize m_size;
98 int m_repetitionCount; 100 int m_repetitionCount;
101 bool m_canYUVDecode;
102
99 bool m_hasColorProfile; 103 bool m_hasColorProfile;
100 bool m_canYUVDecode; 104 RefPtr<ColorSpaceProfile> m_colorProfile;
101 105
102 // Carries only frame state and other information. Does not carry bitmap. 106 // Carries only frame state and other information. Does not carry bitmap.
103 Vector<FrameData> m_frameData; 107 Vector<FrameData> m_frameData;
104 RefPtr<ImageFrameGenerator> m_frameGenerator; 108 RefPtr<ImageFrameGenerator> m_frameGenerator;
105 109
106 static bool s_enabled; 110 static bool s_enabled;
107 }; 111 };
108 112
109 } // namespace blink 113 } // namespace blink
110 114
111 #endif 115 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698