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

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

Issue 1152473006: cc: Remove DrawQuad::IterateResoruces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: iterators! Created 5 years, 6 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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 always_clear = true; 445 always_clear = true;
446 #endif 446 #endif
447 if (always_clear || frame->current_render_pass->has_transparent_background) { 447 if (always_clear || frame->current_render_pass->has_transparent_background) {
448 GLbitfield clear_bits = GL_COLOR_BUFFER_BIT; 448 GLbitfield clear_bits = GL_COLOR_BUFFER_BIT;
449 if (always_clear) 449 if (always_clear)
450 clear_bits |= GL_STENCIL_BUFFER_BIT; 450 clear_bits |= GL_STENCIL_BUFFER_BIT;
451 gl_->Clear(clear_bits); 451 gl_->Clear(clear_bits);
452 } 452 }
453 } 453 }
454 454
455 static ResourceId WaitOnResourceSyncPoints(ResourceProvider* resource_provider,
456 ResourceId resource_id) {
457 resource_provider->WaitSyncPointIfNeeded(resource_id);
458 return resource_id;
459 }
460
461 void GLRenderer::BeginDrawingFrame(DrawingFrame* frame) { 455 void GLRenderer::BeginDrawingFrame(DrawingFrame* frame) {
462 TRACE_EVENT0("cc", "GLRenderer::BeginDrawingFrame"); 456 TRACE_EVENT0("cc", "GLRenderer::BeginDrawingFrame");
463 457
464 scoped_refptr<ResourceProvider::Fence> read_lock_fence; 458 scoped_refptr<ResourceProvider::Fence> read_lock_fence;
465 if (use_sync_query_) { 459 if (use_sync_query_) {
466 // Block until oldest sync query has passed if the number of pending queries 460 // Block until oldest sync query has passed if the number of pending queries
467 // ever reach kMaxPendingSyncQueries. 461 // ever reach kMaxPendingSyncQueries.
468 if (pending_sync_queries_.size() >= kMaxPendingSyncQueries) { 462 if (pending_sync_queries_.size() >= kMaxPendingSyncQueries) {
469 LOG(ERROR) << "Reached limit of pending sync queries."; 463 LOG(ERROR) << "Reached limit of pending sync queries.";
470 464
(...skipping 14 matching lines...) Expand all
485 479
486 read_lock_fence = current_sync_query_->Begin(); 480 read_lock_fence = current_sync_query_->Begin();
487 } else { 481 } else {
488 read_lock_fence = 482 read_lock_fence =
489 make_scoped_refptr(new ResourceProvider::SynchronousFence(gl_)); 483 make_scoped_refptr(new ResourceProvider::SynchronousFence(gl_));
490 } 484 }
491 resource_provider_->SetReadLockFence(read_lock_fence.get()); 485 resource_provider_->SetReadLockFence(read_lock_fence.get());
492 486
493 // Insert WaitSyncPointCHROMIUM on quad resources prior to drawing the frame, 487 // Insert WaitSyncPointCHROMIUM on quad resources prior to drawing the frame,
494 // so that drawing can proceed without GL context switching interruptions. 488 // so that drawing can proceed without GL context switching interruptions.
495 DrawQuad::ResourceIteratorCallback wait_on_resource_syncpoints_callback = 489 ResourceProvider* resource_provider = resource_provider_;
496 base::Bind(&WaitOnResourceSyncPoints, resource_provider_);
497
498 for (const auto& pass : *frame->render_passes_in_draw_order) { 490 for (const auto& pass : *frame->render_passes_in_draw_order) {
499 for (const auto& quad : pass->quad_list) 491 for (const auto& quad : pass->quad_list) {
500 quad->IterateResources(wait_on_resource_syncpoints_callback); 492 for (const ResourceId& resource_id : quad->resources)
piman 2015/05/28 19:35:46 nit: ResourceId instead of const ResourceId&
vmpstr 2015/05/28 22:36:59 Done.
493 resource_provider->WaitSyncPointIfNeeded(resource_id);
494 }
501 } 495 }
502 496
503 // TODO(enne): Do we need to reinitialize all of this state per frame? 497 // TODO(enne): Do we need to reinitialize all of this state per frame?
504 ReinitializeGLState(); 498 ReinitializeGLState();
505 } 499 }
506 500
507 void GLRenderer::DoNoOp() { 501 void GLRenderer::DoNoOp() {
508 gl_->BindFramebuffer(GL_FRAMEBUFFER, 0); 502 gl_->BindFramebuffer(GL_FRAMEBUFFER, 0);
509 gl_->Flush(); 503 gl_->Flush();
510 } 504 }
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 ApplyBackgroundFilters(frame, quad, background_texture.get()); 982 ApplyBackgroundFilters(frame, quad, background_texture.get());
989 } 983 }
990 } 984 }
991 985
992 if (!background_texture) { 986 if (!background_texture) {
993 // Something went wrong with reading the backdrop. 987 // Something went wrong with reading the backdrop.
994 DCHECK(!background_image); 988 DCHECK(!background_image);
995 use_shaders_for_blending = false; 989 use_shaders_for_blending = false;
996 } else if (background_image) { 990 } else if (background_image) {
997 // Reset original background texture if there is not any mask 991 // Reset original background texture if there is not any mask
998 if (!quad->mask_resource_id) 992 if (!quad->mask_resource_id())
999 background_texture.reset(); 993 background_texture.reset();
1000 } else if (CanApplyBlendModeUsingBlendFunc(blend_mode) && 994 } else if (CanApplyBlendModeUsingBlendFunc(blend_mode) &&
1001 ShouldApplyBackgroundFilters(frame, quad)) { 995 ShouldApplyBackgroundFilters(frame, quad)) {
1002 // Something went wrong with applying background filters to the backdrop. 996 // Something went wrong with applying background filters to the backdrop.
1003 use_shaders_for_blending = false; 997 use_shaders_for_blending = false;
1004 background_texture.reset(); 998 background_texture.reset();
1005 } 999 }
1006 } 1000 }
1007 // Need original background texture for mask? 1001 // Need original background texture for mask?
1008 bool mask_for_background = 1002 bool mask_for_background =
1009 background_texture && // Have original background texture 1003 background_texture && // Have original background texture
1010 background_image && // Have filtered background texture 1004 background_image && // Have filtered background texture
1011 quad->mask_resource_id; // Have mask texture 1005 quad->mask_resource_id(); // Have mask texture
1012 SetBlendEnabled( 1006 SetBlendEnabled(
1013 !use_shaders_for_blending && 1007 !use_shaders_for_blending &&
1014 (quad->ShouldDrawWithBlending() || !IsDefaultBlendMode(blend_mode))); 1008 (quad->ShouldDrawWithBlending() || !IsDefaultBlendMode(blend_mode)));
1015 1009
1016 // TODO(senorblanco): Cache this value so that we don't have to do it for both 1010 // TODO(senorblanco): Cache this value so that we don't have to do it for both
1017 // the surface and its replica. Apply filters to the contents texture. 1011 // the surface and its replica. Apply filters to the contents texture.
1018 skia::RefPtr<SkImage> filter_image; 1012 skia::RefPtr<SkImage> filter_image;
1019 SkScalar color_matrix[20]; 1013 SkScalar color_matrix[20];
1020 bool use_color_matrix = false; 1014 bool use_color_matrix = false;
1021 if (!quad->filters.IsEmpty()) { 1015 if (!quad->filters.IsEmpty()) {
(...skipping 16 matching lines...) Expand all
1038 filter_image = ApplyImageFilter( 1032 filter_image = ApplyImageFilter(
1039 ScopedUseGrContext::Create(this, frame), resource_provider_, 1033 ScopedUseGrContext::Create(this, frame), resource_provider_,
1040 quad->rect, quad->filters_scale, filter.get(), contents_texture); 1034 quad->rect, quad->filters_scale, filter.get(), contents_texture);
1041 } 1035 }
1042 } 1036 }
1043 } 1037 }
1044 1038
1045 scoped_ptr<ResourceProvider::ScopedSamplerGL> mask_resource_lock; 1039 scoped_ptr<ResourceProvider::ScopedSamplerGL> mask_resource_lock;
1046 unsigned mask_texture_id = 0; 1040 unsigned mask_texture_id = 0;
1047 SamplerType mask_sampler = SAMPLER_TYPE_NA; 1041 SamplerType mask_sampler = SAMPLER_TYPE_NA;
1048 if (quad->mask_resource_id) { 1042 if (quad->mask_resource_id()) {
1049 mask_resource_lock.reset(new ResourceProvider::ScopedSamplerGL( 1043 mask_resource_lock.reset(new ResourceProvider::ScopedSamplerGL(
1050 resource_provider_, quad->mask_resource_id, GL_TEXTURE1, GL_LINEAR)); 1044 resource_provider_, quad->mask_resource_id(), GL_TEXTURE1, GL_LINEAR));
1051 mask_texture_id = mask_resource_lock->texture_id(); 1045 mask_texture_id = mask_resource_lock->texture_id();
1052 mask_sampler = SamplerTypeFromTextureTarget(mask_resource_lock->target()); 1046 mask_sampler = SamplerTypeFromTextureTarget(mask_resource_lock->target());
1053 } 1047 }
1054 1048
1055 scoped_ptr<ResourceProvider::ScopedSamplerGL> contents_resource_lock; 1049 scoped_ptr<ResourceProvider::ScopedSamplerGL> contents_resource_lock;
1056 if (filter_image) { 1050 if (filter_image) {
1057 GrTexture* texture = filter_image->getTexture(); 1051 GrTexture* texture = filter_image->getTexture();
1058 DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_)); 1052 DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_));
1059 gl_->BindTexture(GL_TEXTURE_2D, texture->getTextureHandle()); 1053 gl_->BindTexture(GL_TEXTURE_2D, texture->getTextureHandle());
1060 } else { 1054 } else {
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
1628 1622
1629 uniforms->sampler_location = program->fragment_shader().sampler_location(); 1623 uniforms->sampler_location = program->fragment_shader().sampler_location();
1630 uniforms->alpha_location = program->fragment_shader().alpha_location(); 1624 uniforms->alpha_location = program->fragment_shader().alpha_location();
1631 uniforms->fragment_tex_transform_location = 1625 uniforms->fragment_tex_transform_location =
1632 program->fragment_shader().fragment_tex_transform_location(); 1626 program->fragment_shader().fragment_tex_transform_location();
1633 } 1627 }
1634 1628
1635 void GLRenderer::DrawTileQuad(const DrawingFrame* frame, 1629 void GLRenderer::DrawTileQuad(const DrawingFrame* frame,
1636 const TileDrawQuad* quad, 1630 const TileDrawQuad* quad,
1637 const gfx::QuadF* clip_region) { 1631 const gfx::QuadF* clip_region) {
1638 DrawContentQuad(frame, quad, quad->resource_id, clip_region); 1632 DrawContentQuad(frame, quad, quad->resource_id(), clip_region);
1639 } 1633 }
1640 1634
1641 void GLRenderer::DrawContentQuad(const DrawingFrame* frame, 1635 void GLRenderer::DrawContentQuad(const DrawingFrame* frame,
1642 const ContentDrawQuadBase* quad, 1636 const ContentDrawQuadBase* quad,
1643 ResourceId resource_id, 1637 ResourceId resource_id,
1644 const gfx::QuadF* clip_region) { 1638 const gfx::QuadF* clip_region) {
1645 gfx::Transform device_transform = 1639 gfx::Transform device_transform =
1646 frame->window_matrix * frame->projection_matrix * quad->quadTransform(); 1640 frame->window_matrix * frame->projection_matrix * quad->quadTransform();
1647 device_transform.FlattenTo2d(); 1641 device_transform.FlattenTo2d();
1648 1642
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
1897 const YUVVideoDrawQuad* quad, 1891 const YUVVideoDrawQuad* quad,
1898 const gfx::QuadF* clip_region) { 1892 const gfx::QuadF* clip_region) {
1899 SetBlendEnabled(quad->ShouldDrawWithBlending()); 1893 SetBlendEnabled(quad->ShouldDrawWithBlending());
1900 1894
1901 TexCoordPrecision tex_coord_precision = TexCoordPrecisionRequired( 1895 TexCoordPrecision tex_coord_precision = TexCoordPrecisionRequired(
1902 gl_, 1896 gl_,
1903 &highp_threshold_cache_, 1897 &highp_threshold_cache_,
1904 highp_threshold_min_, 1898 highp_threshold_min_,
1905 quad->shared_quad_state->visible_content_rect.bottom_right()); 1899 quad->shared_quad_state->visible_content_rect.bottom_right());
1906 1900
1907 bool use_alpha_plane = quad->a_plane_resource_id != 0; 1901 bool use_alpha_plane = quad->a_plane_resource_id() != 0;
1908 1902
1909 ResourceProvider::ScopedSamplerGL y_plane_lock( 1903 ResourceProvider::ScopedSamplerGL y_plane_lock(
1910 resource_provider_, quad->y_plane_resource_id, GL_TEXTURE1, GL_LINEAR); 1904 resource_provider_, quad->y_plane_resource_id(), GL_TEXTURE1, GL_LINEAR);
1911 ResourceProvider::ScopedSamplerGL u_plane_lock( 1905 ResourceProvider::ScopedSamplerGL u_plane_lock(
1912 resource_provider_, quad->u_plane_resource_id, GL_TEXTURE2, GL_LINEAR); 1906 resource_provider_, quad->u_plane_resource_id(), GL_TEXTURE2, GL_LINEAR);
1913 DCHECK_EQ(y_plane_lock.target(), u_plane_lock.target()); 1907 DCHECK_EQ(y_plane_lock.target(), u_plane_lock.target());
1914 ResourceProvider::ScopedSamplerGL v_plane_lock( 1908 ResourceProvider::ScopedSamplerGL v_plane_lock(
1915 resource_provider_, quad->v_plane_resource_id, GL_TEXTURE3, GL_LINEAR); 1909 resource_provider_, quad->v_plane_resource_id(), GL_TEXTURE3, GL_LINEAR);
1916 DCHECK_EQ(y_plane_lock.target(), v_plane_lock.target()); 1910 DCHECK_EQ(y_plane_lock.target(), v_plane_lock.target());
1917 scoped_ptr<ResourceProvider::ScopedSamplerGL> a_plane_lock; 1911 scoped_ptr<ResourceProvider::ScopedSamplerGL> a_plane_lock;
1918 if (use_alpha_plane) { 1912 if (use_alpha_plane) {
1919 a_plane_lock.reset(new ResourceProvider::ScopedSamplerGL( 1913 a_plane_lock.reset(new ResourceProvider::ScopedSamplerGL(
1920 resource_provider_, quad->a_plane_resource_id, GL_TEXTURE4, GL_LINEAR)); 1914 resource_provider_, quad->a_plane_resource_id(), GL_TEXTURE4,
1915 GL_LINEAR));
1921 DCHECK_EQ(y_plane_lock.target(), a_plane_lock->target()); 1916 DCHECK_EQ(y_plane_lock.target(), a_plane_lock->target());
1922 } 1917 }
1923 1918
1924 // All planes must have the same sampler type. 1919 // All planes must have the same sampler type.
1925 SamplerType sampler = SamplerTypeFromTextureTarget(y_plane_lock.target()); 1920 SamplerType sampler = SamplerTypeFromTextureTarget(y_plane_lock.target());
1926 1921
1927 int matrix_location = -1; 1922 int matrix_location = -1;
1928 int ya_tex_scale_location = -1; 1923 int ya_tex_scale_location = -1;
1929 int ya_tex_offset_location = -1; 1924 int ya_tex_offset_location = -1;
1930 int uv_tex_scale_location = -1; 1925 int uv_tex_scale_location = -1;
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
2123 2118
2124 const VideoStreamTextureProgram* program = 2119 const VideoStreamTextureProgram* program =
2125 GetVideoStreamTextureProgram(tex_coord_precision); 2120 GetVideoStreamTextureProgram(tex_coord_precision);
2126 SetUseProgram(program->program()); 2121 SetUseProgram(program->program());
2127 2122
2128 ToGLMatrix(&gl_matrix[0], quad->matrix); 2123 ToGLMatrix(&gl_matrix[0], quad->matrix);
2129 gl_->UniformMatrix4fv(program->vertex_shader().tex_matrix_location(), 1, 2124 gl_->UniformMatrix4fv(program->vertex_shader().tex_matrix_location(), 1,
2130 false, gl_matrix); 2125 false, gl_matrix);
2131 2126
2132 ResourceProvider::ScopedReadLockGL lock(resource_provider_, 2127 ResourceProvider::ScopedReadLockGL lock(resource_provider_,
2133 quad->resource_id); 2128 quad->resource_id());
2134 DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_)); 2129 DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_));
2135 gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id()); 2130 gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id());
2136 2131
2137 gl_->Uniform1i(program->fragment_shader().sampler_location(), 0); 2132 gl_->Uniform1i(program->fragment_shader().sampler_location(), 0);
2138 2133
2139 SetShaderOpacity(quad->opacity(), 2134 SetShaderOpacity(quad->opacity(),
2140 program->fragment_shader().alpha_location()); 2135 program->fragment_shader().alpha_location());
2141 if (!clip_region) { 2136 if (!clip_region) {
2142 DrawQuadGeometry(frame, quad->quadTransform(), quad->rect, 2137 DrawQuadGeometry(frame, quad->quadTransform(), quad->rect,
2143 program->vertex_shader().matrix_location()); 2138 program->vertex_shader().matrix_location());
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
2260 FlushTextureQuadCache(SHARED_BINDING); 2255 FlushTextureQuadCache(SHARED_BINDING);
2261 } 2256 }
2262 2257
2263 TexCoordPrecision tex_coord_precision = TexCoordPrecisionRequired( 2258 TexCoordPrecision tex_coord_precision = TexCoordPrecisionRequired(
2264 gl_, 2259 gl_,
2265 &highp_threshold_cache_, 2260 &highp_threshold_cache_,
2266 highp_threshold_min_, 2261 highp_threshold_min_,
2267 quad->shared_quad_state->visible_content_rect.bottom_right()); 2262 quad->shared_quad_state->visible_content_rect.bottom_right());
2268 2263
2269 ResourceProvider::ScopedReadLockGL lock(resource_provider_, 2264 ResourceProvider::ScopedReadLockGL lock(resource_provider_,
2270 quad->resource_id); 2265 quad->resource_id());
2271 const SamplerType sampler = SamplerTypeFromTextureTarget(lock.target()); 2266 const SamplerType sampler = SamplerTypeFromTextureTarget(lock.target());
2272 // Choose the correct texture program binding 2267 // Choose the correct texture program binding
2273 TexTransformTextureProgramBinding binding; 2268 TexTransformTextureProgramBinding binding;
2274 if (quad->premultiplied_alpha) { 2269 if (quad->premultiplied_alpha) {
2275 if (quad->background_color == SK_ColorTRANSPARENT) { 2270 if (quad->background_color == SK_ColorTRANSPARENT) {
2276 binding.Set(GetTextureProgram(tex_coord_precision, sampler)); 2271 binding.Set(GetTextureProgram(tex_coord_precision, sampler));
2277 } else { 2272 } else {
2278 binding.Set(GetTextureBackgroundProgram(tex_coord_precision, sampler)); 2273 binding.Set(GetTextureBackgroundProgram(tex_coord_precision, sampler));
2279 } 2274 }
2280 } else { 2275 } else {
2281 if (quad->background_color == SK_ColorTRANSPARENT) { 2276 if (quad->background_color == SK_ColorTRANSPARENT) {
2282 binding.Set( 2277 binding.Set(
2283 GetNonPremultipliedTextureProgram(tex_coord_precision, sampler)); 2278 GetNonPremultipliedTextureProgram(tex_coord_precision, sampler));
2284 } else { 2279 } else {
2285 binding.Set(GetNonPremultipliedTextureBackgroundProgram( 2280 binding.Set(GetNonPremultipliedTextureBackgroundProgram(
2286 tex_coord_precision, sampler)); 2281 tex_coord_precision, sampler));
2287 } 2282 }
2288 } 2283 }
2289 2284
2290 int resource_id = quad->resource_id; 2285 int resource_id = quad->resource_id();
2291 2286
2292 if (draw_cache_.program_id != binding.program_id || 2287 if (draw_cache_.program_id != binding.program_id ||
2293 draw_cache_.resource_id != resource_id || 2288 draw_cache_.resource_id != resource_id ||
2294 draw_cache_.needs_blending != quad->ShouldDrawWithBlending() || 2289 draw_cache_.needs_blending != quad->ShouldDrawWithBlending() ||
2295 draw_cache_.nearest_neighbor != quad->nearest_neighbor || 2290 draw_cache_.nearest_neighbor != quad->nearest_neighbor ||
2296 draw_cache_.background_color != quad->background_color || 2291 draw_cache_.background_color != quad->background_color ||
2297 draw_cache_.matrix_data.size() >= 8) { 2292 draw_cache_.matrix_data.size() >= 8) {
2298 FlushTextureQuadCache(SHARED_BINDING); 2293 FlushTextureQuadCache(SHARED_BINDING);
2299 draw_cache_.program_id = binding.program_id; 2294 draw_cache_.program_id = binding.program_id;
2300 draw_cache_.resource_id = resource_id; 2295 draw_cache_.resource_id = resource_id;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
2379 gl_->Uniform4f(binding.tex_transform_location, 0, 0, 2374 gl_->Uniform4f(binding.tex_transform_location, 0, 0,
2380 quad->io_surface_size.width(), 2375 quad->io_surface_size.width(),
2381 quad->io_surface_size.height()); 2376 quad->io_surface_size.height());
2382 } 2377 }
2383 2378
2384 const float vertex_opacity[] = {quad->opacity(), quad->opacity(), 2379 const float vertex_opacity[] = {quad->opacity(), quad->opacity(),
2385 quad->opacity(), quad->opacity()}; 2380 quad->opacity(), quad->opacity()};
2386 gl_->Uniform1fv(binding.vertex_opacity_location, 4, vertex_opacity); 2381 gl_->Uniform1fv(binding.vertex_opacity_location, 4, vertex_opacity);
2387 2382
2388 ResourceProvider::ScopedReadLockGL lock(resource_provider_, 2383 ResourceProvider::ScopedReadLockGL lock(resource_provider_,
2389 quad->io_surface_resource_id); 2384 quad->io_surface_resource_id());
2390 DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_)); 2385 DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_));
2391 gl_->BindTexture(GL_TEXTURE_RECTANGLE_ARB, lock.texture_id()); 2386 gl_->BindTexture(GL_TEXTURE_RECTANGLE_ARB, lock.texture_id());
2392 2387
2393 if (!clip_region) { 2388 if (!clip_region) {
2394 DrawQuadGeometry(frame, quad->quadTransform(), quad->rect, 2389 DrawQuadGeometry(frame, quad->quadTransform(), quad->rect,
2395 binding.matrix_location); 2390 binding.matrix_location);
2396 } else { 2391 } else {
2397 float uvs[8] = {0}; 2392 float uvs[8] = {0};
2398 GetScaledUVs(quad->visible_rect, clip_region, uvs); 2393 GetScaledUVs(quad->visible_rect, clip_region, uvs);
2399 DrawQuadGeometryClippedByQuadF(frame, quad->quadTransform(), quad->rect, 2394 DrawQuadGeometryClippedByQuadF(frame, quad->quadTransform(), quad->rect,
(...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after
3506 context_support_->ScheduleOverlayPlane( 3501 context_support_->ScheduleOverlayPlane(
3507 overlay.plane_z_order, 3502 overlay.plane_z_order,
3508 overlay.transform, 3503 overlay.transform,
3509 pending_overlay_resources_.back()->texture_id(), 3504 pending_overlay_resources_.back()->texture_id(),
3510 ToNearestRect(overlay.display_rect), 3505 ToNearestRect(overlay.display_rect),
3511 overlay.uv_rect); 3506 overlay.uv_rect);
3512 } 3507 }
3513 } 3508 }
3514 3509
3515 } // namespace cc 3510 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698