OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef GPU_GLES2_CONFORM_TEST_DISPLAY_H_ |
| 6 #define GPU_GLES2_CONFORM_TEST_DISPLAY_H_ |
| 7 |
| 8 #include <EGL/egl.h> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "base/scoped_ptr.h" |
| 12 |
| 13 namespace gpu { |
| 14 class CommandBufferService; |
| 15 class GpuScheduler; |
| 16 |
| 17 namespace gles2 { |
| 18 class GLES2CmdHelper; |
| 19 class GLES2Implementation; |
| 20 } // namespace gles2 |
| 21 } // namespace gpu |
| 22 |
| 23 namespace egl { |
| 24 |
| 25 class Config; |
| 26 class Surface; |
| 27 |
| 28 class Display { |
| 29 public: |
| 30 explicit Display(EGLNativeDisplayType display_id); |
| 31 virtual ~Display(); |
| 32 |
| 33 bool is_initialized() const { return is_initialized_; } |
| 34 bool Initialize(); |
| 35 |
| 36 // Config routines. |
| 37 bool IsValidConfig(EGLConfig config); |
| 38 bool GetConfigs(EGLConfig* configs, EGLint config_size, EGLint* num_config); |
| 39 bool GetConfigAttrib(EGLConfig config, EGLint attribute, EGLint* value); |
| 40 |
| 41 // Surface routines. |
| 42 bool IsValidNativeWindow(EGLNativeWindowType win); |
| 43 bool IsValidSurface(EGLSurface surface); |
| 44 EGLSurface CreateWindowSurface(EGLConfig config, |
| 45 EGLNativeWindowType win, |
| 46 const EGLint* attrib_list); |
| 47 void DestroySurface(EGLSurface surface); |
| 48 void SwapBuffers(EGLSurface surface); |
| 49 |
| 50 // Context routines. |
| 51 bool IsValidContext(EGLContext ctx); |
| 52 EGLContext CreateContext(EGLConfig config, |
| 53 EGLContext share_ctx, |
| 54 const EGLint* attrib_list); |
| 55 void DestroyContext(EGLContext ctx); |
| 56 bool MakeCurrent(EGLSurface draw, EGLSurface read, EGLContext ctx); |
| 57 |
| 58 private: |
| 59 EGLNativeDisplayType display_id_; |
| 60 |
| 61 bool is_initialized_; |
| 62 scoped_ptr<gpu::CommandBufferService> command_buffer_; |
| 63 scoped_ptr<gpu::GpuScheduler> gpu_scheduler_; |
| 64 scoped_ptr<gpu::gles2::GLES2CmdHelper> gles2_cmd_helper_; |
| 65 int32 transfer_buffer_id_; |
| 66 |
| 67 // TODO(alokp): Support more than one config, surface, and context. |
| 68 scoped_ptr<Config> config_; |
| 69 scoped_ptr<Surface> surface_; |
| 70 scoped_ptr<gpu::gles2::GLES2Implementation> context_; |
| 71 |
| 72 DISALLOW_COPY_AND_ASSIGN(Display); |
| 73 }; |
| 74 |
| 75 } // namespace egl |
| 76 |
| 77 #endif // GPU_GLES2_CONFORM_TEST_DISPLAY_H_ |
OLD | NEW |