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

Side by Side Diff: android_webview/common/renderer_picture_map.cc

Issue 11732002: [Android WebView] Update SW rendering to use SkPicture and fix scrolling cases. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update to use SkPicture and simplify. Created 7 years, 11 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 | Annotate | Revision Log
OLDNEW
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 #include "android_webview/common/renderer_picture_map.h" 5 #include "android_webview/common/renderer_picture_map.h"
6 6
7 #include "base/logging.h"
8
7 using base::AutoLock; 9 using base::AutoLock;
8 10
9 namespace android_webview { 11 namespace android_webview {
10 12
11 static RendererPictureMap* g_renderer_picture_map = NULL; 13 static RendererPictureMap* g_renderer_picture_map = NULL;
12 14
13 // static 15 // static
14 void RendererPictureMap::CreateInstance() { 16 void RendererPictureMap::CreateInstance() {
15 if (!g_renderer_picture_map) 17 if (!g_renderer_picture_map)
16 g_renderer_picture_map = new RendererPictureMap(); 18 g_renderer_picture_map = new RendererPictureMap();
17 } 19 }
18 20
19 // static 21 // static
20 RendererPictureMap* RendererPictureMap::GetInstance() { 22 RendererPictureMap* RendererPictureMap::GetInstance() {
21 DCHECK(g_renderer_picture_map); 23 DCHECK(g_renderer_picture_map);
22 return g_renderer_picture_map; 24 return g_renderer_picture_map;
23 } 25 }
24 26
25 RendererPictureMap::RendererPictureMap() { 27 RendererPictureMap::RendererPictureMap() {
26 } 28 }
27 29
28 RendererPictureMap::~RendererPictureMap() { 30 RendererPictureMap::~RendererPictureMap() {
29 } 31 }
30 32
31 scoped_refptr<cc::PicturePileImpl> RendererPictureMap::GetRendererPicture( 33 skia::RefPtr<SkPicture> RendererPictureMap::GetRendererPicture(int id) {
32 int id) {
33 AutoLock lock(lock_); 34 AutoLock lock(lock_);
34 return picture_map_[id]; 35 return picture_map_[id];
35 } 36 }
36 37
37 void RendererPictureMap::SetRendererPicture(int id, 38 void RendererPictureMap::SetRendererPicture(int id,
38 scoped_refptr<cc::PicturePileImpl> picture) { 39 skia::RefPtr<SkPicture> picture) {
39 AutoLock lock(lock_); 40 AutoLock lock(lock_);
40 picture_map_[id] = picture; 41 picture_map_[id] = picture;
41 } 42 }
42 43
43 void RendererPictureMap::ClearRendererPicture(int id) { 44 void RendererPictureMap::ClearRendererPicture(int id) {
44 AutoLock lock(lock_); 45 AutoLock lock(lock_);
45 picture_map_.erase(id); 46 picture_map_.erase(id);
46 } 47 }
47 48
48 } // android_webview 49 } // android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698