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

Unified Diff: components/view_manager/gles2/command_buffer_driver.cc

Issue 1245683004: Mandoline: Merge Surfaces and Views apps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed bot issues (I hope) Created 5 years, 4 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/view_manager/gles2/command_buffer_driver.cc
diff --git a/components/view_manager/gles2/command_buffer_driver.cc b/components/view_manager/gles2/command_buffer_driver.cc
index 5a4ac83fb4943738eae6efe524845352e6ee23a7..e31d8e32c10fb7803139d890cb11f2913cdf4afb 100644
--- a/components/view_manager/gles2/command_buffer_driver.cc
+++ b/components/view_manager/gles2/command_buffer_driver.cc
@@ -37,25 +37,13 @@ CommandBufferDriver::Client::~Client() {
}
CommandBufferDriver::CommandBufferDriver(scoped_refptr<GpuState> gpu_state)
- : CommandBufferDriver(gfx::kNullAcceleratedWidget,
- gpu_state,
- base::Callback<void(CommandBufferDriver*)>()) {}
-
-CommandBufferDriver::CommandBufferDriver(
- gfx::AcceleratedWidget widget,
- scoped_refptr<GpuState> gpu_state,
- const base::Callback<void(CommandBufferDriver*)>& destruct_callback)
: client_(nullptr),
- widget_(widget),
gpu_state_(gpu_state),
- destruct_callback_(destruct_callback),
weak_factory_(this) {
}
CommandBufferDriver::~CommandBufferDriver() {
DestroyDecoder();
- if (!destruct_callback_.is_null())
- destruct_callback_.Run(this);
}
void CommandBufferDriver::Initialize(
@@ -88,16 +76,7 @@ bool CommandBufferDriver::MakeCurrent() {
bool CommandBufferDriver::DoInitialize(
mojo::ScopedSharedBufferHandle shared_state) {
- if (widget_ == gfx::kNullAcceleratedWidget)
- surface_ = gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1));
- else {
- surface_ = gfx::GLSurface::CreateViewGLSurface(widget_);
- if (auto vsync_provider = surface_->GetVSyncProvider()) {
- vsync_provider->GetVSyncParameters(
- base::Bind(&CommandBufferDriver::OnUpdateVSyncParameters,
- weak_factory_.GetWeakPtr()));
- }
- }
+ surface_ = gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1));
if (!surface_.get())
return false;
@@ -177,13 +156,6 @@ void CommandBufferDriver::Flush(int32_t put_offset) {
command_buffer_->Flush(put_offset);
}
-void CommandBufferDriver::DestroyWindow() {
- DestroyDecoder();
- surface_ = nullptr;
- context_ = nullptr;
- destruct_callback_.Reset();
-}
-
void CommandBufferDriver::MakeProgress(int32_t last_get_offset) {
// TODO(piman): handle out-of-order.
sync_client_->DidMakeProgress(
@@ -325,12 +297,6 @@ void CommandBufferDriver::OnContextLost(uint32_t reason) {
client_->DidLoseContext();
}
-void CommandBufferDriver::OnUpdateVSyncParameters(
- const base::TimeTicks timebase,
- const base::TimeDelta interval) {
- client_->UpdateVSyncParameters(timebase, interval);
-}
-
void CommandBufferDriver::DestroyDecoder() {
if (decoder_) {
bool have_context = decoder_->MakeCurrent();
« no previous file with comments | « components/view_manager/gles2/command_buffer_driver.h ('k') | components/view_manager/gles2/command_buffer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698