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

Side by Side Diff: mojo/services/gles2/gles2_impl.cc

Issue 131153007: Send size to NativeViewportClient::OnCreated instead of GLES2Client::DidCreateContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, fix various issues Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/services/gles2/gles2.mojom ('k') | mojo/services/native_viewport/native_viewport_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/services/gles2/gles2_impl.h" 5 #include "mojo/services/gles2/gles2_impl.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "gpu/command_buffer/client/gl_in_process_context.h" 9 #include "gpu/command_buffer/client/gl_in_process_context.h"
10 #include "gpu/command_buffer/client/gles2_implementation.h" 10 #include "gpu/command_buffer/client/gles2_implementation.h"
(...skipping 25 matching lines...) Expand all
36 const gfx::Size& size) { 36 const gfx::Size& size) {
37 gpu::GLInProcessContextAttribs attribs; 37 gpu::GLInProcessContextAttribs attribs;
38 gl_context_.reset(gpu::GLInProcessContext::CreateContext( 38 gl_context_.reset(gpu::GLInProcessContext::CreateContext(
39 false, widget, size, false, attribs, gfx::PreferDiscreteGpu)); 39 false, widget, size, false, attribs, gfx::PreferDiscreteGpu));
40 gl_context_->SetContextLostCallback(base::Bind( 40 gl_context_->SetContextLostCallback(base::Bind(
41 &GLES2Impl::OnGLContextLost, base::Unretained(this))); 41 &GLES2Impl::OnGLContextLost, base::Unretained(this)));
42 42
43 gpu::gles2::GLES2Interface* gl = gl_context_->GetImplementation(); 43 gpu::gles2::GLES2Interface* gl = gl_context_->GetImplementation();
44 uint64_t encoded_gl = static_cast<uint64_t>(reinterpret_cast<uintptr_t>(gl)); 44 uint64_t encoded_gl = static_cast<uint64_t>(reinterpret_cast<uintptr_t>(gl));
45 45
46 client_->DidCreateContext(encoded_gl, size.width(), size.height()); 46 client_->DidCreateContext(encoded_gl);
47 } 47 }
48 48
49 void GLES2Impl::OnGLContextLost() { 49 void GLES2Impl::OnGLContextLost() {
50 client_->ContextLost(); 50 client_->ContextLost();
51 } 51 }
52 52
53 void GLES2Impl::DrawAnimationFrame() { 53 void GLES2Impl::DrawAnimationFrame() {
54 client_->DrawAnimationFrame(); 54 client_->DrawAnimationFrame();
55 } 55 }
56 56
57 } // namespace services 57 } // namespace services
58 } // namespace mojo 58 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/services/gles2/gles2.mojom ('k') | mojo/services/native_viewport/native_viewport_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698