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

Side by Side Diff: ui/ozone/demo/egl_demo.cc

Issue 400413002: aura: Use PlatformWindow from WindowTreeHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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 unified diff | Download patch | Annotate | Revision Log
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 "base/at_exit.h" 5 #include "base/at_exit.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "ui/gfx/geometry/size.h" 8 #include "ui/gfx/geometry/size.h"
9 #include "ui/gl/gl_bindings.h" 9 #include "ui/gl/gl_bindings.h"
10 #include "ui/gl/gl_context.h" 10 #include "ui/gl/gl_context.h"
(...skipping 30 matching lines...) Expand all
41 virtual void OnCloseRequest() OVERRIDE {} 41 virtual void OnCloseRequest() OVERRIDE {}
42 virtual void OnClosed() OVERRIDE {} 42 virtual void OnClosed() OVERRIDE {}
43 virtual void OnWindowStateChanged( 43 virtual void OnWindowStateChanged(
44 ui::PlatformWindowState new_state) OVERRIDE {} 44 ui::PlatformWindowState new_state) OVERRIDE {}
45 virtual void OnLostCapture() OVERRIDE {} 45 virtual void OnLostCapture() OVERRIDE {}
46 virtual void OnAcceleratedWidgetAvailable( 46 virtual void OnAcceleratedWidgetAvailable(
47 gfx::AcceleratedWidget widget) OVERRIDE { 47 gfx::AcceleratedWidget widget) OVERRIDE {
48 CHECK_NE(widget, gfx::kNullAcceleratedWidget); 48 CHECK_NE(widget, gfx::kNullAcceleratedWidget);
49 widget_ = widget; 49 widget_ = widget;
50 } 50 }
51 virtual void OnActivationChanged(bool active) OVERRIDE {}
51 52
52 private: 53 private:
53 scoped_ptr<ui::PlatformWindow> platform_window_; 54 scoped_ptr<ui::PlatformWindow> platform_window_;
54 gfx::AcceleratedWidget widget_; 55 gfx::AcceleratedWidget widget_;
55 56
56 DISALLOW_COPY_AND_ASSIGN(DemoWindow); 57 DISALLOW_COPY_AND_ASSIGN(DemoWindow);
57 }; 58 };
58 59
59 int main(int argc, char** argv) { 60 int main(int argc, char** argv) {
60 CommandLine::Init(argc, argv); 61 CommandLine::Init(argc, argv);
(...skipping 30 matching lines...) Expand all
91 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 92 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
92 float fraction = static_cast<float>(i) / iterations; 93 float fraction = static_cast<float>(i) / iterations;
93 glClearColor(1 - fraction, fraction, 0.0, 1.0); 94 glClearColor(1 - fraction, fraction, 0.0, 1.0);
94 95
95 if (!surface->SwapBuffers()) 96 if (!surface->SwapBuffers())
96 LOG(FATAL) << "Failed to swap buffers"; 97 LOG(FATAL) << "Failed to swap buffers";
97 } 98 }
98 99
99 return 0; 100 return 0;
100 } 101 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698