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

Unified Diff: android_webview/browser/hardware_renderer.h

Issue 2090903002: aw: Share cc::Display instance (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android_webview/BUILD.gn ('k') | android_webview/browser/hardware_renderer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/hardware_renderer.h
diff --git a/android_webview/browser/hardware_renderer.h b/android_webview/browser/hardware_renderer.h
index f6d0d43453e4b866c8bd0498f3a152b3ada79916..352dba45e11fea93896641574080ba55375b591f 100644
--- a/android_webview/browser/hardware_renderer.h
+++ b/android_webview/browser/hardware_renderer.h
@@ -8,9 +8,8 @@
#include <memory>
#include "android_webview/browser/compositor_id.h"
-#include "android_webview/browser/render_thread_manager.h"
#include "base/macros.h"
-#include "cc/surfaces/display_client.h"
+#include "base/memory/ref_counted.h"
#include "cc/surfaces/surface_factory_client.h"
#include "cc/surfaces/surface_id.h"
@@ -25,13 +24,12 @@ class SurfaceManager;
namespace android_webview {
-class AwGLSurface;
class ChildFrame;
-class ParentOutputSurface;
+class RenderThreadManager;
class ScopedAppGLStateRestore;
+class SurfacesInstance;
-class HardwareRenderer : public cc::DisplayClient,
- public cc::SurfaceFactoryClient {
+class HardwareRenderer : public cc::SurfaceFactoryClient {
public:
explicit HardwareRenderer(RenderThreadManager* state);
~HardwareRenderer() override;
@@ -42,10 +40,6 @@ class HardwareRenderer : public cc::DisplayClient,
void SetBackingFrameBufferObject(int framebuffer_binding_ext);
private:
- // cc::DisplayClient overrides.
- void DisplayOutputSurfaceLost() override {}
- void DisplaySetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) override {}
-
// cc::SurfaceFactoryClient implementation.
void ReturnResources(const cc::ReturnedResourceArray& resources) override;
void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override;
@@ -55,6 +49,9 @@ class HardwareRenderer : public cc::DisplayClient,
const CompositorID& compositor_id,
uint32_t output_surface_id);
+ void AllocateSurface();
+ void DestroySurface();
+
RenderThreadManager* render_thread_manager_;
typedef void* EGLContext;
@@ -71,23 +68,16 @@ class HardwareRenderer : public cc::DisplayClient,
// SurfaceFactory.
std::unique_ptr<ChildFrame> child_frame_;
- scoped_refptr<AwGLSurface> gl_surface_;
-
- std::unique_ptr<cc::SurfaceManager> surface_manager_;
- std::unique_ptr<cc::Display> display_;
+ const scoped_refptr<SurfacesInstance> surfaces_;
+ const std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_;
std::unique_ptr<cc::SurfaceFactory> surface_factory_;
- std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_;
cc::SurfaceId child_id_;
- cc::SurfaceId root_id_;
CompositorID compositor_id_;
// HardwareRenderer guarantees resources are returned in the order of
// output_surface_id, and resources for old output surfaces are dropped.
uint32_t last_committed_output_surface_id_;
uint32_t last_submitted_output_surface_id_;
- // This is owned by |display_|.
- ParentOutputSurface* output_surface_;
-
DISALLOW_COPY_AND_ASSIGN(HardwareRenderer);
};
« no previous file with comments | « android_webview/BUILD.gn ('k') | android_webview/browser/hardware_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698