OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |