Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: cc/output/geometry_binding.h

Issue 595593002: Splitting of layers for correct intersections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes from issues introduced by the rebase, added tests for video_quads. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/output/geometry_binding.h
diff --git a/cc/output/geometry_binding.h b/cc/output/geometry_binding.h
index cfa21efd1fc1ef2c7bbcdb03b982c1421191d5c2..92814e7246362ad6760cbd149ef4c41b20e22c91 100644
--- a/cc/output/geometry_binding.h
+++ b/cc/output/geometry_binding.h
@@ -6,33 +6,41 @@
#define CC_OUTPUT_GEOMETRY_BINDING_H_
#include "base/basictypes.h"
+#include "cc/output/gl_renderer.h" // For the GLC() macro.
+#include "gpu/command_buffer/client/gles2_interface.h"
#include "third_party/khronos/GLES2/gl2.h"
+#include "third_party/khronos/GLES2/gl2ext.h"
+#include "ui/gfx/geometry/rect_f.h"
namespace gfx {
-class RectF;
-}
-namespace gpu {
-namespace gles2 {
-class GLES2Interface;
-}
+class QuadF;
+class Quad;
+class QuadIndex;
+class PointF;
}
+using gpu::gles2::GLES2Interface;
namespace cc {
-class GeometryBinding {
- public:
- GeometryBinding(gpu::gles2::GLES2Interface* gl,
- const gfx::RectF& quad_vertex_rect);
- ~GeometryBinding();
-
- void PrepareForDraw();
+class DrawQuad;
+class DrawPolygon;
+struct GeometryBinding {
// All layer shaders share the same attribute locations for the vertex
// positions and texture coordinates. This allows switching shaders without
// rebinding attribute arrays.
static int PositionAttribLocation() { return 0; }
static int TexCoordAttribLocation() { return 1; }
static int TriangleIndexAttribLocation() { return 2; }
+};
+
+class StaticGeometryBinding {
enne (OOO) 2015/02/04 21:23:59 Can you put the different bindings in different he
awoloszyn 2015/02/12 16:48:51 Done.
+ public:
+ StaticGeometryBinding(gpu::gles2::GLES2Interface* gl,
+ const gfx::RectF& quad_vertex_rect);
+ ~StaticGeometryBinding();
+
+ void PrepareForDraw();
private:
gpu::gles2::GLES2Interface* gl_;
@@ -40,7 +48,22 @@ class GeometryBinding {
GLuint quad_vertices_vbo_;
GLuint quad_elements_vbo_;
- DISALLOW_COPY_AND_ASSIGN(GeometryBinding);
+ DISALLOW_COPY_AND_ASSIGN(StaticGeometryBinding);
+};
+
+class DynamicGeometryBinding {
+ public:
+ explicit DynamicGeometryBinding(gpu::gles2::GLES2Interface* gl);
+ void PrepareForDraw();
+ void InitializeCustomQuad(const gfx::QuadF& quad);
+ void InitializeCustomQuadWithUVs(const gfx::QuadF& quad, const float uv[8]);
enne (OOO) 2015/02/04 21:23:59 const float& uv[8]
awoloszyn 2015/02/12 16:48:51 Done.
+
+ private:
+ gpu::gles2::GLES2Interface* gl_;
+
+ GLuint quad_vertices_vbo_;
+ GLuint quad_elements_vbo_;
+ DISALLOW_COPY_AND_ASSIGN(DynamicGeometryBinding);
};
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698