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

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

Issue 822713002: Update from https://crrev.com/309415 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 12 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 unified diff | Download patch
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 2042 matching lines...) Expand 10 before | Expand all | Expand 10 after
2053 GLC(gl_, gl_->Uniform1i(draw_cache_.sampler_location, 0)); 2053 GLC(gl_, gl_->Uniform1i(draw_cache_.sampler_location, 0));
2054 2054
2055 // Assume the current active textures is 0. 2055 // Assume the current active textures is 0.
2056 ResourceProvider::ScopedSamplerGL locked_quad( 2056 ResourceProvider::ScopedSamplerGL locked_quad(
2057 resource_provider_, 2057 resource_provider_,
2058 draw_cache_.resource_id, 2058 draw_cache_.resource_id,
2059 draw_cache_.nearest_neighbor ? GL_NEAREST : GL_LINEAR); 2059 draw_cache_.nearest_neighbor ? GL_NEAREST : GL_LINEAR);
2060 DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_)); 2060 DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_));
2061 GLC(gl_, gl_->BindTexture(GL_TEXTURE_2D, locked_quad.texture_id())); 2061 GLC(gl_, gl_->BindTexture(GL_TEXTURE_2D, locked_quad.texture_id()));
2062 2062
2063 COMPILE_ASSERT(sizeof(Float4) == 4 * sizeof(float), struct_is_densely_packed); 2063 static_assert(sizeof(Float4) == 4 * sizeof(float),
2064 COMPILE_ASSERT(sizeof(Float16) == 16 * sizeof(float), 2064 "Float4 struct should be densely packed");
2065 struct_is_densely_packed); 2065 static_assert(sizeof(Float16) == 16 * sizeof(float),
2066 "Float16 struct should be densely packed");
2066 2067
2067 // Upload the tranforms for both points and uvs. 2068 // Upload the tranforms for both points and uvs.
2068 GLC(gl_, 2069 GLC(gl_,
2069 gl_->UniformMatrix4fv( 2070 gl_->UniformMatrix4fv(
2070 static_cast<int>(draw_cache_.matrix_location), 2071 static_cast<int>(draw_cache_.matrix_location),
2071 static_cast<int>(draw_cache_.matrix_data.size()), 2072 static_cast<int>(draw_cache_.matrix_data.size()),
2072 false, 2073 false,
2073 reinterpret_cast<float*>(&draw_cache_.matrix_data.front()))); 2074 reinterpret_cast<float*>(&draw_cache_.matrix_data.front())));
2074 GLC(gl_, 2075 GLC(gl_,
2075 gl_->Uniform4fv( 2076 gl_->Uniform4fv(
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after
3287 context_support_->ScheduleOverlayPlane( 3288 context_support_->ScheduleOverlayPlane(
3288 overlay.plane_z_order, 3289 overlay.plane_z_order,
3289 overlay.transform, 3290 overlay.transform,
3290 pending_overlay_resources_.back()->texture_id(), 3291 pending_overlay_resources_.back()->texture_id(),
3291 overlay.display_rect, 3292 overlay.display_rect,
3292 overlay.uv_rect); 3293 overlay.uv_rect);
3293 } 3294 }
3294 } 3295 }
3295 3296
3296 } // namespace cc 3297 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698