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

Side by Side Diff: content/browser/android/transient_ui_resource.h

Issue 143803004: android: Migrate old content readback to use async readback (and delegated renderer) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 6 years, 10 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
OLDNEW
(Empty)
1 // Copyright 2013 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 CONTENT_BROWSER_ANDROID_TRANSIENT_UI_RESOURCE_H_
6 #define CONTENT_BROWSER_ANDROID_TRANSIENT_UI_RESOURCE_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "cc/resources/ui_resource_client.h"
10 #include "ui/gfx/size.h"
11
12 namespace cc {
13
14 class LayerTreeHost;
15 class UIResourceBitmap;
16
17 }
18
19 namespace content {
20
21 // This UIResourceClient immediately frees the pixels after it has been queried
22 // once. Subsequent GetBitmap() calls will return a small holder.
no sievers 2014/01/28 20:47:22 Do we really need this class? The way this works,
powei 2014/01/29 13:53:17 Done.
23 class TransientUIResource : public cc::UIResourceClient {
24 public:
25 static scoped_ptr<TransientUIResource> Create(
26 cc::LayerTreeHost* host,
27 const cc::UIResourceBitmap& bitmap);
28 virtual ~TransientUIResource();
29
30 // UIResourceClient implementation.
31 virtual cc::UIResourceBitmap GetBitmap(cc::UIResourceId uid,
32 bool resource_lost) OVERRIDE;
33 cc::UIResourceId id() { return id_; }
34
35 protected:
36 TransientUIResource(cc::LayerTreeHost* host,
37 const cc::UIResourceBitmap& bitmap);
38
39 scoped_ptr<cc::UIResourceBitmap> bitmap_;
40 cc::LayerTreeHost* host_;
41 cc::UIResourceId id_;
42
43 private:
44 DISALLOW_COPY_AND_ASSIGN(TransientUIResource);
45 };
46
47 } // namespace content
48
49 #endif // CONTENT_BROWSER_ANDROID_TRANSIENT_UI_RESOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698