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" |
11 #include "ui/gl/gl_surface.h" | 11 #include "ui/gl/gl_surface.h" |
12 #include "ui/ozone/public/ozone_platform.h" | 12 #include "ui/ozone/public/ozone_platform.h" |
13 #include "ui/ozone/public/surface_factory_ozone.h" | 13 #include "ui/ozone/public/surface_factory_ozone.h" |
14 #include "ui/platform_window/platform_window.h" | 14 #include "ui/platform_window/types/platform_window.h" |
15 #include "ui/platform_window/platform_window_delegate.h" | 15 #include "ui/platform_window/types/platform_window_delegate.h" |
16 | 16 |
17 const int kTestWindowWidth = 800; | 17 const int kTestWindowWidth = 800; |
18 const int kTestWindowHeight = 600; | 18 const int kTestWindowHeight = 600; |
19 | 19 |
20 class DemoWindow : public ui::PlatformWindowDelegate { | 20 class DemoWindow : public ui::PlatformWindowDelegate { |
21 public: | 21 public: |
22 DemoWindow() : widget_(gfx::kNullAcceleratedWidget) { | 22 DemoWindow() : widget_(gfx::kNullAcceleratedWidget) { |
23 platform_window_ = ui::OzonePlatform::GetInstance()->CreatePlatformWindow( | 23 platform_window_ = ui::OzonePlatform::GetInstance()->CreatePlatformWindow( |
24 this, gfx::Rect(kTestWindowWidth, kTestWindowHeight)); | 24 this, gfx::Rect(kTestWindowWidth, kTestWindowHeight)); |
25 } | 25 } |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); | 92 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
93 float fraction = static_cast<float>(i) / iterations; | 93 float fraction = static_cast<float>(i) / iterations; |
94 glClearColor(1 - fraction, fraction, 0.0, 1.0); | 94 glClearColor(1 - fraction, fraction, 0.0, 1.0); |
95 | 95 |
96 if (!surface->SwapBuffers()) | 96 if (!surface->SwapBuffers()) |
97 LOG(FATAL) << "Failed to swap buffers"; | 97 LOG(FATAL) << "Failed to swap buffers"; |
98 } | 98 } |
99 | 99 |
100 return 0; | 100 return 0; |
101 } | 101 } |
OLD | NEW |