| 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 {} | |
| 52 | 51 |
| 53 private: | 52 private: |
| 54 scoped_ptr<ui::PlatformWindow> platform_window_; | 53 scoped_ptr<ui::PlatformWindow> platform_window_; |
| 55 gfx::AcceleratedWidget widget_; | 54 gfx::AcceleratedWidget widget_; |
| 56 | 55 |
| 57 DISALLOW_COPY_AND_ASSIGN(DemoWindow); | 56 DISALLOW_COPY_AND_ASSIGN(DemoWindow); |
| 58 }; | 57 }; |
| 59 | 58 |
| 60 int main(int argc, char** argv) { | 59 int main(int argc, char** argv) { |
| 61 CommandLine::Init(argc, argv); | 60 CommandLine::Init(argc, argv); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 92 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); | 91 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
| 93 float fraction = static_cast<float>(i) / iterations; | 92 float fraction = static_cast<float>(i) / iterations; |
| 94 glClearColor(1 - fraction, fraction, 0.0, 1.0); | 93 glClearColor(1 - fraction, fraction, 0.0, 1.0); |
| 95 | 94 |
| 96 if (!surface->SwapBuffers()) | 95 if (!surface->SwapBuffers()) |
| 97 LOG(FATAL) << "Failed to swap buffers"; | 96 LOG(FATAL) << "Failed to swap buffers"; |
| 98 } | 97 } |
| 99 | 98 |
| 100 return 0; | 99 return 0; |
| 101 } | 100 } |
| OLD | NEW |