1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef MOZILLA_GFX_DRAWEVENTRECORDER_H_
7 #define MOZILLA_GFX_DRAWEVENTRECORDER_H_
10 #include "RecordedEvent.h"
25 class DrawEventRecorderPrivate
: public DrawEventRecorder
28 MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawEventRecorderPrivate
)
29 explicit DrawEventRecorderPrivate(std::ostream
*aStream
);
30 virtual ~DrawEventRecorderPrivate() { }
32 void RecordEvent(const RecordedEvent
&aEvent
);
33 void WritePath(const PathRecording
*aPath
);
35 void AddStoredPath(const ReferencePtr aPath
) {
36 mStoredPaths
.insert(aPath
);
39 void RemoveStoredPath(const ReferencePtr aPath
) {
40 mStoredPaths
.erase(aPath
);
43 bool HasStoredPath(const ReferencePtr aPath
) {
44 if (mStoredPaths
.find(aPath
) != mStoredPaths
.end()) {
51 std::ostream
*mOutputStream
;
53 virtual void Flush() = 0;
56 typedef stdext::hash_set
<const void*> ObjectSet
;
58 typedef std::set
<const void*> ObjectSet
;
61 ObjectSet mStoredPaths
;
62 ObjectSet mStoredScaledFonts
;
65 class DrawEventRecorderFile
: public DrawEventRecorderPrivate
68 MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawEventRecorderFile
)
69 explicit DrawEventRecorderFile(const char *aFilename
);
70 ~DrawEventRecorderFile();
75 std::ofstream mOutputFile
;
81 #endif /* MOZILLA_GFX_DRAWEVENTRECORDER_H_ */