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

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: Separate Compositor plumbing from SetContentView 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id, 93 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id,
93 gfx::JavaBitmap& bitmap) = 0; 94 gfx::JavaBitmap& bitmap) = 0;
94 95
95 // Grabs a copy of |texture_id| and saves it into |bitmap|. No scaling is 96 // Grabs a copy of |texture_id| and saves it into |bitmap|. No scaling is
96 // done. |src_rect| allows the caller to specify which rect of |texture_id| 97 // done. |src_rect| allows the caller to specify which rect of |texture_id|
97 // to copy to |bitmap|. It needs to match the size of |bitmap|. Returns 98 // to copy to |bitmap|. It needs to match the size of |bitmap|. Returns
98 // true if the |texture_id| was copied into |bitmap|, false if not. 99 // true if the |texture_id| was copied into |bitmap|, false if not.
99 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id, 100 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id,
100 const gfx::Rect& src_rect, 101 const gfx::Rect& src_rect,
101 gfx::JavaBitmap& bitmap) = 0; 102 gfx::JavaBitmap& bitmap) = 0;
103 virtual void AddObserver(CompositorObserver* observer) = 0;
104 virtual void RemoveObserver(CompositorObserver* observer) = 0;
105 virtual bool HasObserver(CompositorObserver* observer) = 0;
106
102 protected: 107 protected:
103 Compositor() {} 108 Compositor() {}
104 }; 109 };
105 110
106 } // namespace content 111 } // namespace content
107 112
108 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ 113 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698