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

Unified Diff: cc/output/geometry_binding.h

Issue 1531403002: Revert "Delete CC." (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « cc/output/filter_operations_unittest.cc ('k') | cc/output/geometry_binding.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/geometry_binding.h
diff --git a/cc/output/geometry_binding.h b/cc/output/geometry_binding.h
new file mode 100644
index 0000000000000000000000000000000000000000..ae6868744c38c5ca421471e0594e572645acf8a4
--- /dev/null
+++ b/cc/output/geometry_binding.h
@@ -0,0 +1,70 @@
+// Copyright 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_OUTPUT_GEOMETRY_BINDING_H_
+#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 QuadF;
+class Quad;
+class QuadIndex;
+class PointF;
+}
+
+namespace cc {
+
+struct GeometryBindingVertex {
+ float a_position[3];
+ float a_texCoord[2];
+ // Index of the vertex, divide by 4 to have the matrix for this quad.
+ float a_index;
+};
+
+struct GeometryBindingQuad {
+ GeometryBindingQuad();
+ GeometryBindingQuad(const GeometryBindingVertex& vert0,
+ const GeometryBindingVertex& vert1,
+ const GeometryBindingVertex& vert2,
+ const GeometryBindingVertex& vert3);
+ GeometryBindingVertex v0, v1, v2, v3;
+};
+
+struct GeometryBindingQuadIndex {
+ GeometryBindingQuadIndex();
+ GeometryBindingQuadIndex(uint16 index0,
+ uint16 index1,
+ uint16 index2,
+ uint16 index3,
+ uint16 index4,
+ uint16 index5);
+
+ uint16 data[6];
+};
+
+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; }
+};
+
+void SetupGLContext(gpu::gles2::GLES2Interface* gl,
+ GLuint quad_elements_vbo,
+ GLuint quad_vertices_vbo);
+
+} // namespace cc
+
+#endif // CC_OUTPUT_GEOMETRY_BINDING_H_
« no previous file with comments | « cc/output/filter_operations_unittest.cc ('k') | cc/output/geometry_binding.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698