OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef ANDROID_WEBVIEW_COMMON_RENDERER_PICTURE_MAP_H_ | |
6 #define ANDROID_WEBVIEW_COMMON_RENDERER_PICTURE_MAP_H_ | |
7 | |
8 #include <map> | |
9 | |
10 #include "base/synchronization/lock.h" | |
11 #include "skia/ext/refptr.h" | |
12 #include "third_party/skia/include/core/SkPicture.h" | |
13 | |
14 namespace android_webview { | |
15 | |
16 // Stores pictures received from diferent renderers and associates them by | |
17 // renderer id. Will only work in single process mode. | |
18 class RendererPictureMap { | |
19 public: | |
20 static void CreateInstance(); | |
21 static RendererPictureMap* GetInstance(); | |
22 | |
23 skia::RefPtr<SkPicture> GetRendererPicture(int id); | |
24 void SetRendererPicture(int id, skia::RefPtr<SkPicture> picture); | |
25 void ClearRendererPicture(int id); | |
26 | |
27 private: | |
28 RendererPictureMap(); | |
29 ~RendererPictureMap(); | |
30 | |
31 typedef std::map<int, skia::RefPtr<SkPicture> > PictureMap; | |
32 PictureMap picture_map_; | |
33 base::Lock lock_; | |
34 }; | |
35 | |
36 } // android_webview | |
37 | |
38 #endif // ANDROID_WEBVIEW_COMMON_RENDERER_PICTURE_MAP_H_ | |
OLD | NEW |