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

Unified Diff: mojo/services/gles2/command_buffer_impl.cc

Issue 354933002: Connect X11 ConfigureNotify events to Mojo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed double-notification for node bounds changes Created 6 years, 5 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 | « mojo/services/gles2/command_buffer_impl.h ('k') | mojo/services/native_viewport/native_viewport_x11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/gles2/command_buffer_impl.cc
diff --git a/mojo/services/gles2/command_buffer_impl.cc b/mojo/services/gles2/command_buffer_impl.cc
index 090b78c370709a9d0f2ff2b0237f92d472da2e36..438ff903f87fda1dce04bed89ed92fd18dbf2d4b 100644
--- a/mojo/services/gles2/command_buffer_impl.cc
+++ b/mojo/services/gles2/command_buffer_impl.cc
@@ -73,18 +73,17 @@ void CommandBufferImpl::Initialize(
bool CommandBufferImpl::DoInitialize(
mojo::ScopedSharedBufferHandle shared_state) {
// TODO(piman): offscreen surface.
- scoped_refptr<gfx::GLSurface> surface =
- gfx::GLSurface::CreateViewGLSurface(widget_);
- if (!surface.get())
+ surface_ = gfx::GLSurface::CreateViewGLSurface(widget_);
+ if (!surface_.get())
return false;
// TODO(piman): context sharing, virtual contexts, gpu preference.
scoped_refptr<gfx::GLContext> context = gfx::GLContext::CreateGLContext(
- NULL, surface.get(), gfx::PreferIntegratedGpu);
+ NULL, surface_.get(), gfx::PreferIntegratedGpu);
if (!context.get())
return false;
- if (!context->MakeCurrent(surface.get()))
+ if (!context->MakeCurrent(surface_.get()))
return false;
// TODO(piman): ShaderTranslatorCache is currently per-ContextGroup but
@@ -106,12 +105,14 @@ bool CommandBufferImpl::DoInitialize(
scheduler_.reset(new gpu::GpuScheduler(
command_buffer_.get(), decoder_.get(), decoder_.get()));
decoder_->set_engine(scheduler_.get());
+ decoder_->SetResizeCallback(
+ base::Bind(&CommandBufferImpl::OnResize, base::Unretained(this)));
gpu::gles2::DisallowedFeatures disallowed_features;
// TODO(piman): attributes.
std::vector<int32> attrib_vector;
- if (!decoder_->Initialize(surface,
+ if (!decoder_->Initialize(surface_,
context,
false /* offscreen */,
size_,
@@ -194,5 +195,9 @@ void CommandBufferImpl::OnParseError() {
void CommandBufferImpl::DrawAnimationFrame() { client()->DrawAnimationFrame(); }
+void CommandBufferImpl::OnResize(gfx::Size size, float scale_factor) {
+ surface_->Resize(size);
+}
+
} // namespace services
} // namespace mojo
« no previous file with comments | « mojo/services/gles2/command_buffer_impl.h ('k') | mojo/services/native_viewport/native_viewport_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698