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

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

Issue 1497683002: Make platform/graphics to use USING_FAST_MALLOC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 13 matching lines...) Expand all
24 */ 24 */
25 25
26 #ifndef ImageFrameGenerator_h 26 #ifndef ImageFrameGenerator_h
27 #define ImageFrameGenerator_h 27 #define ImageFrameGenerator_h
28 28
29 #include "SkBitmap.h" 29 #include "SkBitmap.h"
30 #include "SkSize.h" 30 #include "SkSize.h"
31 #include "SkTypes.h" 31 #include "SkTypes.h"
32 #include "platform/PlatformExport.h" 32 #include "platform/PlatformExport.h"
33 #include "platform/graphics/ThreadSafeDataTransport.h" 33 #include "platform/graphics/ThreadSafeDataTransport.h"
34 #include "wtf/Allocator.h"
35 #include "wtf/Noncopyable.h"
34 #include "wtf/PassOwnPtr.h" 36 #include "wtf/PassOwnPtr.h"
35 #include "wtf/PassRefPtr.h" 37 #include "wtf/PassRefPtr.h"
36 #include "wtf/RefCounted.h" 38 #include "wtf/RefCounted.h"
37 #include "wtf/RefPtr.h" 39 #include "wtf/RefPtr.h"
38 #include "wtf/ThreadingPrimitives.h" 40 #include "wtf/ThreadingPrimitives.h"
39 #include "wtf/ThreadSafeRefCounted.h" 41 #include "wtf/ThreadSafeRefCounted.h"
40 #include "wtf/Vector.h" 42 #include "wtf/Vector.h"
41 43
42 namespace blink { 44 namespace blink {
43 45
44 class ImageDecoder; 46 class ImageDecoder;
45 class SharedBuffer; 47 class SharedBuffer;
46 48
47 class PLATFORM_EXPORT ImageDecoderFactory { 49 class PLATFORM_EXPORT ImageDecoderFactory {
50 USING_FAST_MALLOC(ImageDecoderFactory);
48 WTF_MAKE_NONCOPYABLE(ImageDecoderFactory); 51 WTF_MAKE_NONCOPYABLE(ImageDecoderFactory);
49 public: 52 public:
50 ImageDecoderFactory() {} 53 ImageDecoderFactory() {}
51 virtual ~ImageDecoderFactory() { } 54 virtual ~ImageDecoderFactory() { }
52 virtual PassOwnPtr<ImageDecoder> create() = 0; 55 virtual PassOwnPtr<ImageDecoder> create() = 0;
53 }; 56 };
54 57
55 class PLATFORM_EXPORT ImageFrameGenerator : public ThreadSafeRefCounted<ImageFra meGenerator> { 58 class PLATFORM_EXPORT ImageFrameGenerator final : public ThreadSafeRefCounted<Im ageFrameGenerator> {
56 WTF_MAKE_NONCOPYABLE(ImageFrameGenerator); 59 WTF_MAKE_NONCOPYABLE(ImageFrameGenerator);
57 public: 60 public:
58 static PassRefPtr<ImageFrameGenerator> create(const SkISize& fullSize, PassR efPtr<SharedBuffer> data, bool allDataReceived, bool isMultiFrame = false) 61 static PassRefPtr<ImageFrameGenerator> create(const SkISize& fullSize, PassR efPtr<SharedBuffer> data, bool allDataReceived, bool isMultiFrame = false)
59 { 62 {
60 return adoptRef(new ImageFrameGenerator(fullSize, data, allDataReceived, isMultiFrame)); 63 return adoptRef(new ImageFrameGenerator(fullSize, data, allDataReceived, isMultiFrame));
61 } 64 }
62 65
63 ImageFrameGenerator(const SkISize& fullSize, PassRefPtr<SharedBuffer>, bool allDataReceived, bool isMultiFrame); 66 ImageFrameGenerator(const SkISize& fullSize, PassRefPtr<SharedBuffer>, bool allDataReceived, bool isMultiFrame);
64 ~ImageFrameGenerator(); 67 ~ImageFrameGenerator();
65 68
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 size_t m_frameCount; 116 size_t m_frameCount;
114 OwnPtr<ExternalMemoryAllocator> m_externalAllocator; 117 OwnPtr<ExternalMemoryAllocator> m_externalAllocator;
115 118
116 OwnPtr<ImageDecoderFactory> m_imageDecoderFactory; 119 OwnPtr<ImageDecoderFactory> m_imageDecoderFactory;
117 120
118 // Prevents multiple decode operations on the same data. 121 // Prevents multiple decode operations on the same data.
119 Mutex m_decodeMutex; 122 Mutex m_decodeMutex;
120 123
121 // Protect concurrent access to m_hasAlpha. 124 // Protect concurrent access to m_hasAlpha.
122 Mutex m_alphaMutex; 125 Mutex m_alphaMutex;
126
127 #if COMPILER(MSVC)
128 friend struct ::WTF::OwnedPtrDeleter<ExternalMemoryAllocator>;
129 #endif
123 }; 130 };
124 131
125 } // namespace blink 132 } // namespace blink
126 133
127 #endif 134 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698