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 "ui/ozone/platform/egltest/ozone_platform_egltest.h" | 5 #include "ui/ozone/platform/egltest/ozone_platform_egltest.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 // | 193 // |
194 // This just manages the native window lifetime using | 194 // This just manages the native window lifetime using |
195 // ShimGetNativeWindow & ShimReleaseNativeWindow. | 195 // ShimGetNativeWindow & ShimReleaseNativeWindow. |
196 class SurfaceOzoneEgltest : public SurfaceOzoneEGL { | 196 class SurfaceOzoneEgltest : public SurfaceOzoneEGL { |
197 public: | 197 public: |
198 SurfaceOzoneEgltest(ShimNativeWindowId window_id, | 198 SurfaceOzoneEgltest(ShimNativeWindowId window_id, |
199 LibeglplatformShimLoader* eglplatform_shim) | 199 LibeglplatformShimLoader* eglplatform_shim) |
200 : eglplatform_shim_(eglplatform_shim) { | 200 : eglplatform_shim_(eglplatform_shim) { |
201 native_window_ = eglplatform_shim_->ShimGetNativeWindow(window_id); | 201 native_window_ = eglplatform_shim_->ShimGetNativeWindow(window_id); |
202 } | 202 } |
203 ~SurfaceOzoneEgltest() { | 203 ~SurfaceOzoneEgltest() override { |
204 bool ret = eglplatform_shim_->ShimReleaseNativeWindow(native_window_); | 204 bool ret = eglplatform_shim_->ShimReleaseNativeWindow(native_window_); |
205 DCHECK(ret); | 205 DCHECK(ret); |
206 } | 206 } |
207 | 207 |
208 intptr_t GetNativeWindow() override { return native_window_; } | 208 intptr_t GetNativeWindow() override { return native_window_; } |
209 | 209 |
210 bool OnSwapBuffers() override { return true; } | 210 bool OnSwapBuffers() override { return true; } |
211 | 211 |
212 bool ResizeNativeWindow(const gfx::Size& viewport_size) override { | 212 bool ResizeNativeWindow(const gfx::Size& viewport_size) override { |
213 return true; | 213 return true; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 | 285 |
286 // Test platform for EGL. | 286 // Test platform for EGL. |
287 // | 287 // |
288 // This is a tiny EGL-based platform. Creation of the native window is | 288 // This is a tiny EGL-based platform. Creation of the native window is |
289 // handled by a separate library called eglplatform_shim.so.1 because | 289 // handled by a separate library called eglplatform_shim.so.1 because |
290 // this itself is platform specific and we want to test out multiple | 290 // this itself is platform specific and we want to test out multiple |
291 // hardware platforms. | 291 // hardware platforms. |
292 class OzonePlatformEgltest : public OzonePlatform { | 292 class OzonePlatformEgltest : public OzonePlatform { |
293 public: | 293 public: |
294 OzonePlatformEgltest() : shim_initialized_(false) {} | 294 OzonePlatformEgltest() : shim_initialized_(false) {} |
295 virtual ~OzonePlatformEgltest() { | 295 ~OzonePlatformEgltest() override { |
296 if (shim_initialized_) | 296 if (shim_initialized_) |
297 eglplatform_shim_.ShimTerminate(); | 297 eglplatform_shim_.ShimTerminate(); |
298 } | 298 } |
299 | 299 |
300 void LoadShim() { | 300 void LoadShim() { |
301 std::string library = GetShimLibraryName(); | 301 std::string library = GetShimLibraryName(); |
302 | 302 |
303 if (eglplatform_shim_.Load(library)) | 303 if (eglplatform_shim_.Load(library)) |
304 return; | 304 return; |
305 | 305 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 | 385 |
386 } // namespace | 386 } // namespace |
387 | 387 |
388 OzonePlatform* CreateOzonePlatformEgltest() { | 388 OzonePlatform* CreateOzonePlatformEgltest() { |
389 OzonePlatformEgltest* platform = new OzonePlatformEgltest; | 389 OzonePlatformEgltest* platform = new OzonePlatformEgltest; |
390 platform->Initialize(); | 390 platform->Initialize(); |
391 return platform; | 391 return platform; |
392 } | 392 } |
393 | 393 |
394 } // namespace ui | 394 } // namespace ui |
OLD | NEW |