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

Side by Side Diff: mojo/examples/compositor_app/compositor_host.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
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/examples/compositor_app/compositor_host.h" 5 #include "mojo/examples/compositor_app/compositor_host.h"
6 6
7 #include "cc/layers/layer.h" 7 #include "cc/layers/layer.h"
8 #include "cc/layers/solid_color_layer.h" 8 #include "cc/layers/solid_color_layer.h"
9 #include "cc/output/context_provider.h" 9 #include "cc/output/context_provider.h"
10 #include "cc/output/output_surface.h" 10 #include "cc/output/output_surface.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 DCHECK(started); 60 DCHECK(started);
61 61
62 cc::LayerTreeSettings settings; 62 cc::LayerTreeSettings settings;
63 tree_ = cc::LayerTreeHost::CreateThreaded( 63 tree_ = cc::LayerTreeHost::CreateThreaded(
64 this, NULL, settings, compositor_thread_.message_loop_proxy()); 64 this, NULL, settings, compositor_thread_.message_loop_proxy());
65 SetupScene(); 65 SetupScene();
66 } 66 }
67 67
68 CompositorHost::~CompositorHost() {} 68 CompositorHost::~CompositorHost() {}
69 69
70 void CompositorHost::DidCreateContext(gfx::Size viewport_size) { 70 void CompositorHost::SetSize(gfx::Size viewport_size) {
71 tree_->SetViewportSize(viewport_size); 71 tree_->SetViewportSize(viewport_size);
72 }
73
74 void CompositorHost::DidCreateContext() {
72 tree_->SetLayerTreeHostClientReady(); 75 tree_->SetLayerTreeHostClientReady();
73 tree_->InitializeOutputSurfaceIfNeeded(); 76 tree_->InitializeOutputSurfaceIfNeeded();
74 } 77 }
75 78
76 void CompositorHost::SetupScene() { 79 void CompositorHost::SetupScene() {
77 scoped_refptr<cc::Layer> root_layer = cc::SolidColorLayer::Create(); 80 scoped_refptr<cc::Layer> root_layer = cc::SolidColorLayer::Create();
78 root_layer->SetBounds(gfx::Size(500, 500)); 81 root_layer->SetBounds(gfx::Size(500, 500));
79 root_layer->SetBackgroundColor(SK_ColorBLUE); 82 root_layer->SetBackgroundColor(SK_ColorBLUE);
80 root_layer->SetIsDrawable(true); 83 root_layer->SetIsDrawable(true);
81 tree_->SetRootLayer(root_layer); 84 tree_->SetRootLayer(root_layer);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 void CompositorHost::DidCommit() {} 123 void CompositorHost::DidCommit() {}
121 void CompositorHost::DidCommitAndDrawFrame() {} 124 void CompositorHost::DidCommitAndDrawFrame() {}
122 void CompositorHost::DidCompleteSwapBuffers() {} 125 void CompositorHost::DidCompleteSwapBuffers() {}
123 126
124 scoped_refptr<cc::ContextProvider> CompositorHost::OffscreenContextProvider() { 127 scoped_refptr<cc::ContextProvider> CompositorHost::OffscreenContextProvider() {
125 return NULL; 128 return NULL;
126 } 129 }
127 130
128 } // namespace examples 131 } // namespace examples
129 } // namespace mojo 132 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/examples/compositor_app/compositor_host.h ('k') | mojo/examples/compositor_app/gles2_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698