1 // Copyright 2018 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 DEVICE_VR_ANDROID_ARCORE_AR_RENDERER_H_
6 #define DEVICE_VR_ANDROID_ARCORE_AR_RENDERER_H_
7 
8 #include "base/macros.h"
9 #include "ui/gl/gl_bindings.h"
10 
11 namespace device {
12 
13 // Issues GL for rendering a texture for AR.
14 // TODO(crbug.com/838013): Share code with WebVrRenderer.
15 class ArRenderer {
16  public:
17   ArRenderer();
18   ~ArRenderer();
19 
20   void Draw(int texture_handle, const float (&uv_transform)[16]);
21 
22  private:
23   GLuint program_handle_ = 0;
24   GLuint position_handle_ = 0;
25   GLuint clip_rect_handle_ = 0;
26   GLuint texture_handle_ = 0;
27   GLuint uv_transform_ = 0;
28   GLuint vertex_buffer_ = 0;
29   GLuint index_buffer_ = 0;
30 
31   DISALLOW_COPY_AND_ASSIGN(ArRenderer);
32 };
33 
34 }  // namespace device
35 
36 #endif  // DEVICE_VR_ANDROID_ARCORE_AR_RENDERER_H_
37