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

Side by Side Diff: content/public/browser/android/compositor.h

Issue 26753005: Adding compositor callbacks to RenderWidgetHostViewAndroid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed blank lines Created 7 years, 2 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
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 CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_
6 #define CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "cc/resources/ui_resource_bitmap.h" 9 #include "cc/resources/ui_resource_bitmap.h"
10 #include "cc/resources/ui_resource_client.h" 10 #include "cc/resources/ui_resource_client.h"
11 #include "content/common/content_export.h" 11 #include "content/common/content_export.h"
12 #include "ui/gfx/native_widget_types.h" 12 #include "ui/gfx/native_widget_types.h"
13 #include "ui/gfx/rect.h" 13 #include "ui/gfx/rect.h"
14 #include "ui/gfx/size.h" 14 #include "ui/gfx/size.h"
15 15
16 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" 16 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
17 17
18 namespace cc { 18 namespace cc {
19 class Layer; 19 class Layer;
20 } 20 }
21 21
22 namespace gfx { 22 namespace gfx {
23 class JavaBitmap; 23 class JavaBitmap;
24 } 24 }
25 25
26 namespace content { 26 namespace content {
27 class CompositorClient; 27 class CompositorClient;
28 class CompositorObserver;
28 29
29 // An interface to the browser-side compositor. 30 // An interface to the browser-side compositor.
30 class CONTENT_EXPORT Compositor { 31 class CONTENT_EXPORT Compositor {
31 public: 32 public:
32 virtual ~Compositor() {} 33 virtual ~Compositor() {}
33 34
34 // Performs the global initialization needed before any compositor 35 // Performs the global initialization needed before any compositor
35 // instance can be used. This should be called only once. 36 // instance can be used. This should be called only once.
36 static void Initialize(); 37 static void Initialize();
37 38
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id, 96 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id,
96 gfx::JavaBitmap& bitmap) = 0; 97 gfx::JavaBitmap& bitmap) = 0;
97 98
98 // Grabs a copy of |texture_id| and saves it into |bitmap|. No scaling is 99 // Grabs a copy of |texture_id| and saves it into |bitmap|. No scaling is
99 // done. |src_rect| allows the caller to specify which rect of |texture_id| 100 // done. |src_rect| allows the caller to specify which rect of |texture_id|
100 // to copy to |bitmap|. It needs to match the size of |bitmap|. Returns 101 // to copy to |bitmap|. It needs to match the size of |bitmap|. Returns
101 // true if the |texture_id| was copied into |bitmap|, false if not. 102 // true if the |texture_id| was copied into |bitmap|, false if not.
102 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id, 103 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id,
103 const gfx::Rect& src_rect, 104 const gfx::Rect& src_rect,
104 gfx::JavaBitmap& bitmap) = 0; 105 gfx::JavaBitmap& bitmap) = 0;
106 virtual void AddObserver(CompositorObserver* observer) = 0;
107 virtual void RemoveObserver(CompositorObserver* observer) = 0;
108 virtual bool HasObserver(CompositorObserver* observer) = 0;
no sievers 2013/10/10 17:48:03 nit: newline before 'protected:'
powei 2013/10/16 22:42:35 Done.
105 protected: 109 protected:
106 Compositor() {} 110 Compositor() {}
107 }; 111 };
108 112
109 } // namespace content 113 } // namespace content
110 114
111 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ 115 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698