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

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

Issue 1880993003: Use RefPtr for SkBitmap::Allocator in ImageDecoder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sharedBufferInterface6
Patch Set: Rebase to ToT Created 4 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 private: 92 private:
93 ImageFrameGenerator(const SkISize& fullSize, bool isMultiFrame); 93 ImageFrameGenerator(const SkISize& fullSize, bool isMultiFrame);
94 94
95 friend class ImageFrameGeneratorTest; 95 friend class ImageFrameGeneratorTest;
96 friend class DeferredImageDecoderTest; 96 friend class DeferredImageDecoderTest;
97 // For testing. |factory| will overwrite the default ImageDecoder creation l ogic if |factory->create()| returns non-zero. 97 // For testing. |factory| will overwrite the default ImageDecoder creation l ogic if |factory->create()| returns non-zero.
98 void setImageDecoderFactory(PassOwnPtr<ImageDecoderFactory> factory) { m_ima geDecoderFactory = std::move(factory); } 98 void setImageDecoderFactory(PassOwnPtr<ImageDecoderFactory> factory) { m_ima geDecoderFactory = std::move(factory); }
99 99
100 void setHasAlpha(size_t index, bool hasAlpha); 100 void setHasAlpha(size_t index, bool hasAlpha);
101 101
102 SkBitmap tryToResumeDecode(SegmentReader*, bool allDataReceived, size_t inde x, const SkISize& scaledSize, SkBitmap::Allocator*); 102 SkBitmap tryToResumeDecode(SegmentReader*, bool allDataReceived, size_t inde x, const SkISize& scaledSize, PassRefPtr<SkBitmap::Allocator>);
103 // This method should only be called while m_decodeMutex is locked. 103 // This method should only be called while m_decodeMutex is locked.
104 bool decode(SegmentReader*, bool allDataReceived, size_t index, ImageDecoder **, SkBitmap*, SkBitmap::Allocator*); 104 bool decode(SegmentReader*, bool allDataReceived, size_t index, ImageDecoder **, SkBitmap*, PassRefPtr<SkBitmap::Allocator>);
105 105
106 const SkISize m_fullSize; 106 const SkISize m_fullSize;
107 107
108 const bool m_isMultiFrame; 108 const bool m_isMultiFrame;
109 bool m_decodeFailed; 109 bool m_decodeFailed;
110 bool m_yuvDecodingFailed; 110 bool m_yuvDecodingFailed;
111 size_t m_frameCount; 111 size_t m_frameCount;
112 Vector<bool> m_hasAlpha; 112 Vector<bool> m_hasAlpha;
113 113
114 OwnPtr<ImageDecoderFactory> m_imageDecoderFactory; 114 OwnPtr<ImageDecoderFactory> m_imageDecoderFactory;
115 115
116 // Prevents multiple decode operations on the same data. 116 // Prevents multiple decode operations on the same data.
117 Mutex m_decodeMutex; 117 Mutex m_decodeMutex;
118 118
119 // Protect concurrent access to m_hasAlpha. 119 // Protect concurrent access to m_hasAlpha.
120 Mutex m_alphaMutex; 120 Mutex m_alphaMutex;
121 }; 121 };
122 122
123 } // namespace blink 123 } // namespace blink
124 124
125 #endif 125 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698