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