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

Side by Side Diff: cc/output/gl_renderer.cc

Issue 804373004: replace COMPILE_ASSERT with static_assert in cc/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « cc/output/geometry_binding.cc ('k') | cc/quads/largest_draw_quad.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/output/gl_renderer.h" 5 #include "cc/output/gl_renderer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 2043 matching lines...) Expand 10 before | Expand all | Expand 10 after
2054 GLC(gl_, gl_->Uniform1i(draw_cache_.sampler_location, 0)); 2054 GLC(gl_, gl_->Uniform1i(draw_cache_.sampler_location, 0));
2055 2055
2056 // Assume the current active textures is 0. 2056 // Assume the current active textures is 0.
2057 ResourceProvider::ScopedSamplerGL locked_quad( 2057 ResourceProvider::ScopedSamplerGL locked_quad(
2058 resource_provider_, 2058 resource_provider_,
2059 draw_cache_.resource_id, 2059 draw_cache_.resource_id,
2060 draw_cache_.nearest_neighbor ? GL_NEAREST : GL_LINEAR); 2060 draw_cache_.nearest_neighbor ? GL_NEAREST : GL_LINEAR);
2061 DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_)); 2061 DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_));
2062 GLC(gl_, gl_->BindTexture(GL_TEXTURE_2D, locked_quad.texture_id())); 2062 GLC(gl_, gl_->BindTexture(GL_TEXTURE_2D, locked_quad.texture_id()));
2063 2063
2064 COMPILE_ASSERT(sizeof(Float4) == 4 * sizeof(float), struct_is_densely_packed); 2064 static_assert(sizeof(Float4) == 4 * sizeof(float),
2065 COMPILE_ASSERT(sizeof(Float16) == 16 * sizeof(float), 2065 "Float4 struct should be densely packed");
2066 struct_is_densely_packed); 2066 static_assert(sizeof(Float16) == 16 * sizeof(float),
2067 "Float16 struct should be densely packed");
2067 2068
2068 // Upload the tranforms for both points and uvs. 2069 // Upload the tranforms for both points and uvs.
2069 GLC(gl_, 2070 GLC(gl_,
2070 gl_->UniformMatrix4fv( 2071 gl_->UniformMatrix4fv(
2071 static_cast<int>(draw_cache_.matrix_location), 2072 static_cast<int>(draw_cache_.matrix_location),
2072 static_cast<int>(draw_cache_.matrix_data.size()), 2073 static_cast<int>(draw_cache_.matrix_data.size()),
2073 false, 2074 false,
2074 reinterpret_cast<float*>(&draw_cache_.matrix_data.front()))); 2075 reinterpret_cast<float*>(&draw_cache_.matrix_data.front())));
2075 GLC(gl_, 2076 GLC(gl_,
2076 gl_->Uniform4fv( 2077 gl_->Uniform4fv(
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after
3288 context_support_->ScheduleOverlayPlane( 3289 context_support_->ScheduleOverlayPlane(
3289 overlay.plane_z_order, 3290 overlay.plane_z_order,
3290 overlay.transform, 3291 overlay.transform,
3291 pending_overlay_resources_.back()->texture_id(), 3292 pending_overlay_resources_.back()->texture_id(),
3292 overlay.display_rect, 3293 overlay.display_rect,
3293 overlay.uv_rect); 3294 overlay.uv_rect);
3294 } 3295 }
3295 } 3296 }
3296 3297
3297 } // namespace cc 3298 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/geometry_binding.cc ('k') | cc/quads/largest_draw_quad.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698