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

Unified Diff: components/mus/surfaces/direct_output_surface_ozone.cc

Issue 2049083002: Implement MusGpuMemoryBufferManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update the mojom document 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: components/mus/surfaces/direct_output_surface_ozone.cc
diff --git a/components/mus/surfaces/direct_output_surface_ozone.cc b/components/mus/surfaces/direct_output_surface_ozone.cc
index 1df897da6e84bf561b5c3204ad7c7448cb0f8268..ec13d9bd1b48f823caf5b2fa3e53ba7407c35688 100644
--- a/components/mus/surfaces/direct_output_surface_ozone.cc
+++ b/components/mus/surfaces/direct_output_surface_ozone.cc
@@ -11,7 +11,9 @@
#include "cc/output/context_provider.h"
#include "cc/output/output_surface_client.h"
#include "components/display_compositor/buffer_queue.h"
+#include "components/mus/common/gpu_service.h"
#include "components/mus/common/mojo_gpu_memory_buffer_manager.h"
+#include "components/mus/gpu/mus_gpu_memory_buffer_manager.h"
#include "components/mus/surfaces/surfaces_context_provider.h"
#include "gpu/command_buffer/client/context_support.h"
#include "gpu/command_buffer/client/gles2_interface.h"
@@ -29,16 +31,21 @@ DirectOutputSurfaceOzone::DirectOutputSurfaceOzone(
: cc::OutputSurface(context_provider, nullptr, nullptr),
gl_helper_(context_provider->ContextGL(),
context_provider->ContextSupport()),
- buffer_queue_(new BufferQueue(context_provider->ContextGL(),
- target,
- internalformat,
- &gl_helper_,
- &gpu_memory_buffer_manager_,
- widget)),
synthetic_begin_frame_source_(new cc::SyntheticBeginFrameSource(
task_runner,
cc::BeginFrameArgs::DefaultInterval())),
weak_ptr_factory_(this) {
+ if (!GpuService::UseChromeGpuCommandBuffer()) {
+ ozone_gpu_memory_buffer_manager_.reset(new OzoneGpuMemoryBufferManager());
+ buffer_queue_.reset(new BufferQueue(
+ context_provider->ContextGL(), target, internalformat, &gl_helper_,
+ ozone_gpu_memory_buffer_manager_.get(), widget));
+ } else {
+ buffer_queue_.reset(new BufferQueue(
+ context_provider->ContextGL(), target, internalformat, &gl_helper_,
+ MusGpuMemoryBufferManager::current(), widget));
+ }
+
capabilities_.uses_default_gl_framebuffer = false;
capabilities_.flipped_output_surface = true;
// Set |max_frames_pending| to 2 for surfaceless, which aligns scheduling
« no previous file with comments | « components/mus/surfaces/direct_output_surface_ozone.h ('k') | components/mus/surfaces/surfaces_context_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698