summaryrefslogtreecommitdiffstats
path: root/cc/output/dynamic_geometry_binding.cc
diff options
context:
space:
mode:
authorgab <gab@chromium.org>2015-03-11 12:46:25 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-11 19:47:03 +0000
commitf0d5e0d31ba3659eb782d87baf95539ccd2b6d36 (patch)
tree1d8da0d173681c6b1c53363199cb0a88bb1decae /cc/output/dynamic_geometry_binding.cc
parent00d86e3ed50b7fd59f0dd0bbb0277361a27e0a5a (diff)
downloadchromium_src-f0d5e0d31ba3659eb782d87baf95539ccd2b6d36.zip
chromium_src-f0d5e0d31ba3659eb782d87baf95539ccd2b6d36.tar.gz
chromium_src-f0d5e0d31ba3659eb782d87baf95539ccd2b6d36.tar.bz2
Revert of Splitting of layers for correct intersections (patchset #20 id:370001 of https://codereview.chromium.org/595593002/)
Reason for revert: Appears to be adding new static initializers and is breaking Mac/Linux builders, e.g.: http://build.chromium.org/p/chromium/buildstatus?builder=Mac&number=34562 Original issue's description: > Splitting of layers for correct intersections > > Sorting 3d-sorted layers and rendering them in that order causes issues > when layers intersect. Instead place 3d-sorted layers in a bsp tree and > fragment any intersecting layers into non-rectangular quads. We can then > render the fragments in the correct sorted order regardless of > intersections. > > BUG=455918,159225,132122,230833 > > Committed: https://crrev.com/7e2af77dcd3b5df086be3421fad40b719779381c > Cr-Commit-Position: refs/heads/master@{#320096} TBR=enne@chromium.org,danakj@chromium.org,eroman@chromium.org,thakis@chromium.org,awoloszyn@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=455918,159225,132122,230833 Review URL: https://codereview.chromium.org/998023002 Cr-Commit-Position: refs/heads/master@{#320122}
Diffstat (limited to 'cc/output/dynamic_geometry_binding.cc')
-rw-r--r--cc/output/dynamic_geometry_binding.cc67
1 files changed, 0 insertions, 67 deletions
diff --git a/cc/output/dynamic_geometry_binding.cc b/cc/output/dynamic_geometry_binding.cc
deleted file mode 100644
index 9e25892..0000000
--- a/cc/output/dynamic_geometry_binding.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2015 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.
-
-#include "cc/output/dynamic_geometry_binding.h"
-
-#include "cc/output/gl_renderer.h" // For the GLC() macro.
-#include "gpu/command_buffer/client/gles2_interface.h"
-#include "ui/gfx/geometry/rect_f.h"
-
-namespace cc {
-
-DynamicGeometryBinding::DynamicGeometryBinding(gpu::gles2::GLES2Interface* gl)
- : gl_(gl), quad_vertices_vbo_(0), quad_elements_vbo_(0) {
- GeometryBindingQuad quads[1];
- GeometryBindingQuadIndex quad_indices[1];
-
- static_assert(sizeof(GeometryBindingQuad) == 24 * sizeof(float),
- "struct Quad should be densely packed");
- static_assert(sizeof(GeometryBindingQuadIndex) == 6 * sizeof(uint16_t),
- "struct QuadIndex should be densely packed");
-
- GLC(gl_, gl_->GenBuffers(1, &quad_vertices_vbo_));
- GLC(gl_, gl_->GenBuffers(1, &quad_elements_vbo_));
-
- GLC(gl_, gl_->BindBuffer(GL_ARRAY_BUFFER, quad_vertices_vbo_));
- GLC(gl_, gl_->BufferData(GL_ARRAY_BUFFER, sizeof(GeometryBindingQuad) * 1,
- quads, GL_DYNAMIC_DRAW));
-
- GLC(gl_, gl_->BindBuffer(GL_ELEMENT_ARRAY_BUFFER, quad_elements_vbo_));
- GLC(gl_, gl_->BufferData(GL_ELEMENT_ARRAY_BUFFER,
- sizeof(GeometryBindingQuadIndex) * 1, &quad_indices,
- GL_DYNAMIC_DRAW));
-}
-
-void DynamicGeometryBinding::InitializeCustomQuad(const gfx::QuadF& quad) {
- float uv[] = {0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f};
- InitializeCustomQuadWithUVs(quad, uv);
-}
-
-void DynamicGeometryBinding::InitializeCustomQuadWithUVs(const gfx::QuadF& quad,
- const float uv[8]) {
- GeometryBindingVertex v0 = {
- {quad.p1().x(), quad.p1().y(), 0.0f}, {uv[0], uv[1]}, 0.0f};
- GeometryBindingVertex v1 = {
- {quad.p2().x(), quad.p2().y(), 0.0f}, {uv[2], uv[3]}, 1.0f};
- GeometryBindingVertex v2 = {
- {quad.p3().x(), quad.p3().y(), 0.0f}, {uv[4], uv[5]}, 2.0f};
- GeometryBindingVertex v3 = {
- {quad.p4().x(), quad.p4().y(), 0.0f}, {uv[6], uv[7]}, 3.0f};
-
- GeometryBindingQuad local_quad = {v0, v1, v2, v3};
- GeometryBindingQuadIndex quad_index(
- static_cast<uint16>(0), static_cast<uint16>(1), static_cast<uint16>(2),
- static_cast<uint16>(3), static_cast<uint16>(0), static_cast<uint16>(2));
-
- GLC(gl_, gl_->BufferSubData(GL_ARRAY_BUFFER, 0, sizeof(GeometryBindingQuad),
- &local_quad));
- GLC(gl_, gl_->BufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0,
- sizeof(GeometryBindingQuadIndex), &quad_index));
-}
-
-void DynamicGeometryBinding::PrepareForDraw() {
- SetupGLContext(gl_, quad_elements_vbo_, quad_vertices_vbo_);
-}
-
-} // namespace cc