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

Unified Diff: content/browser/compositor/mus_browser_compositor_output_surface.h

Issue 2096843002: mus+ash: Enable Chrome HW rendering in mus+ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update 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
Index: content/browser/compositor/mus_browser_compositor_output_surface.h
diff --git a/content/browser/compositor/gpu_browser_compositor_output_surface.h b/content/browser/compositor/mus_browser_compositor_output_surface.h
similarity index 69%
copy from content/browser/compositor/gpu_browser_compositor_output_surface.h
copy to content/browser/compositor/mus_browser_compositor_output_surface.h
index 5d2c7ed66e13d098b30595408c26f805c1ee4ba1..0b974089841fa6fa741f2366a187beb247c512fb 100644
--- a/content/browser/compositor/gpu_browser_compositor_output_surface.h
+++ b/content/browser/compositor/mus_browser_compositor_output_surface.h
@@ -1,16 +1,18 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
+// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
-#define CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
+#ifndef CONTENT_BROWSER_COMPOSITOR_MUS_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
+#define CONTENT_BROWSER_COMPOSITOR_MUS_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
#include <memory>
#include "base/cancelable_callback.h"
#include "base/macros.h"
#include "build/build_config.h"
+#include "components/mus/public/cpp/window_surface_client.h"
#include "content/browser/compositor/browser_compositor_output_surface.h"
+#include "gpu/ipc/common/surface_handle.h"
#include "ui/gfx/swap_result.h"
namespace display_compositor {
@@ -21,6 +23,10 @@ namespace gpu {
class CommandBufferProxyImpl;
}
+namespace mus {
+class WindowSurface;
+}
+
namespace ui {
class CompositorVSyncManager;
}
@@ -31,17 +37,18 @@ class ReflectorTexture;
// Adapts a WebGraphicsContext3DCommandBufferImpl into a
// cc::OutputSurface that also handles vsync parameter updates
// arriving from the GPU process.
-class GpuBrowserCompositorOutputSurface
- : public BrowserCompositorOutputSurface {
+class MusBrowserCompositorOutputSurface : public BrowserCompositorOutputSurface,
+ public mus::WindowSurfaceClient {
public:
- GpuBrowserCompositorOutputSurface(
+ MusBrowserCompositorOutputSurface(
+ gpu::SurfaceHandle surface_handle,
scoped_refptr<ContextProviderCommandBuffer> context,
scoped_refptr<ui::CompositorVSyncManager> vsync_manager,
cc::SyntheticBeginFrameSource* begin_frame_source,
std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator>
overlay_candidate_validator);
- ~GpuBrowserCompositorOutputSurface() override;
+ ~MusBrowserCompositorOutputSurface() override;
protected:
// BrowserCompositorOutputSurface:
@@ -59,6 +66,11 @@ class GpuBrowserCompositorOutputSurface
bool BindToClient(cc::OutputSurfaceClient* client) override;
uint32_t GetFramebufferCopyTextureFormat() override;
+ // mus::WindowSurfaceClient:
+ void OnResourcesReturned(
+ mus::WindowSurface* surface,
+ mojo::Array<cc::ReturnedResource> resources) override;
+
gpu::CommandBufferProxyImpl* GetCommandBufferProxy();
base::CancelableCallback<void(
@@ -72,9 +84,11 @@ class GpuBrowserCompositorOutputSurface
std::unique_ptr<ReflectorTexture> reflector_texture_;
- DISALLOW_COPY_AND_ASSIGN(GpuBrowserCompositorOutputSurface);
+ std::unique_ptr<mus::WindowSurface> mus_window_surface_;
+
+ DISALLOW_COPY_AND_ASSIGN(MusBrowserCompositorOutputSurface);
};
} // namespace content
-#endif // CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
+#endif // CONTENT_BROWSER_COMPOSITOR_MUS_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_

Powered by Google App Engine
This is Rietveld 408576698