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

Side by Side Diff: mojo/gles2/gles2_client_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, 10 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/gles2/gles2_client_impl.h ('k') | mojo/public/gles2/gles2_types.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/gles2/gles2_client_impl.h" 5 #include "mojo/gles2/gles2_client_impl.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <GLES2/gl2ext.h> 8 #include <GLES2/gl2ext.h>
9 9
10 #include "mojo/public/gles2/gles2.h" 10 #include "mojo/public/gles2/gles2.h"
(...skipping 20 matching lines...) Expand all
31 } 31 }
32 32
33 void GLES2ClientImpl::RequestAnimationFrames() { 33 void GLES2ClientImpl::RequestAnimationFrames() {
34 service_->RequestAnimationFrames(); 34 service_->RequestAnimationFrames();
35 } 35 }
36 36
37 void GLES2ClientImpl::CancelAnimationFrames() { 37 void GLES2ClientImpl::CancelAnimationFrames() {
38 service_->CancelAnimationFrames(); 38 service_->CancelAnimationFrames();
39 } 39 }
40 40
41 void GLES2ClientImpl::DidCreateContext(uint64_t encoded, 41 void GLES2ClientImpl::DidCreateContext(uint64_t encoded) {
42 uint32_t width,
43 uint32_t height) {
44 // Ack, Hans! It's the giant hack. 42 // Ack, Hans! It's the giant hack.
45 // TODO(abarth): Replace this hack with something more disciplined. Most 43 // TODO(abarth): Replace this hack with something more disciplined. Most
46 // likley, we should receive a MojoHandle that we use to wire up the 44 // likley, we should receive a MojoHandle that we use to wire up the
47 // client side of an out-of-process command buffer. Given that we're 45 // client side of an out-of-process command buffer. Given that we're
48 // still in-process, we just reinterpret_cast the value into a GL interface. 46 // still in-process, we just reinterpret_cast the value into a GL interface.
49 implementation_ = reinterpret_cast<gpu::gles2::GLES2Implementation*>( 47 implementation_ = reinterpret_cast<gpu::gles2::GLES2Implementation*>(
50 static_cast<uintptr_t>(encoded)); 48 static_cast<uintptr_t>(encoded));
51 created_callback_(closure_, width, height); 49 created_callback_(closure_);
52 } 50 }
53 51
54 void GLES2ClientImpl::ContextLost() { 52 void GLES2ClientImpl::ContextLost() {
55 lost_callback_(closure_); 53 lost_callback_(closure_);
56 } 54 }
57 55
58 void GLES2ClientImpl::DrawAnimationFrame() { 56 void GLES2ClientImpl::DrawAnimationFrame() {
59 animation_callback_(closure_); 57 animation_callback_(closure_);
60 } 58 }
61 59
62 } // namespace examples 60 } // namespace examples
63 } // namespace mojo 61 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/gles2/gles2_client_impl.h ('k') | mojo/public/gles2/gles2_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698