1 // Copyright 2015 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 COMPONENTS_VIZ_SERVICE_DISPLAY_DYNAMIC_GEOMETRY_BINDING_H_
6 #define COMPONENTS_VIZ_SERVICE_DISPLAY_DYNAMIC_GEOMETRY_BINDING_H_
7 
8 #include "base/macros.h"
9 #include "components/viz/service/display/geometry_binding.h"
10 #include "components/viz/service/viz_service_export.h"
11 
12 namespace gfx {
13 class QuadF;
14 }
15 
16 namespace viz {
17 
18 class VIZ_SERVICE_EXPORT DynamicGeometryBinding {
19  public:
20   explicit DynamicGeometryBinding(gpu::gles2::GLES2Interface* gl);
21   ~DynamicGeometryBinding();
22 
23   void PrepareForDraw();
24   void InitializeCustomQuad(const gfx::QuadF& quad);
25   void InitializeCustomQuadWithUVs(const gfx::QuadF& quad, const float uv[8]);
26 
27  private:
28   gpu::gles2::GLES2Interface* gl_;
29 
30   GLuint quad_vertices_vbo_;
31   GLuint quad_elements_vbo_;
32 
33   DISALLOW_COPY_AND_ASSIGN(DynamicGeometryBinding);
34 };
35 
36 }  // namespace viz
37 
38 #endif  // COMPONENTS_VIZ_SERVICE_DISPLAY_DYNAMIC_GEOMETRY_BINDING_H_
39