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

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

Issue 2158633002: cc: DCHECK background_image_id only if there is a background image (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | 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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 // This function allocates a texture, which should contribute to the 1058 // This function allocates a texture, which should contribute to the
1059 // amount of memory used by render surfaces: 1059 // amount of memory used by render surfaces:
1060 // LayerTreeHost::CalculateMemoryForRenderSurfaces. 1060 // LayerTreeHost::CalculateMemoryForRenderSurfaces.
1061 background_texture = GetBackdropTexture(background_rect); 1061 background_texture = GetBackdropTexture(background_rect);
1062 1062
1063 if (ShouldApplyBackgroundFilters(quad) && background_texture) { 1063 if (ShouldApplyBackgroundFilters(quad) && background_texture) {
1064 // Apply the background filters to R, so that it is applied in the 1064 // Apply the background filters to R, so that it is applied in the
1065 // pixels' coordinate space. 1065 // pixels' coordinate space.
1066 background_image = ApplyBackgroundFilters( 1066 background_image = ApplyBackgroundFilters(
1067 frame, quad, background_texture.get(), gfx::RectF(background_rect)); 1067 frame, quad, background_texture.get(), gfx::RectF(background_rect));
1068 if (background_image) 1068 if (background_image) {
1069 background_image_id = skia::GrBackendObjectToGrGLTextureInfo( 1069 background_image_id = skia::GrBackendObjectToGrGLTextureInfo(
1070 background_image->getTextureHandle(true)) 1070 background_image->getTextureHandle(true))
1071 ->fID; 1071 ->fID;
1072 DCHECK(background_image_id); 1072 DCHECK(background_image_id);
1073 }
1073 } 1074 }
1074 } 1075 }
1075 1076
1076 if (!background_texture) { 1077 if (!background_texture) {
1077 // Something went wrong with reading the backdrop. 1078 // Something went wrong with reading the backdrop.
1078 DCHECK(!background_image_id); 1079 DCHECK(!background_image_id);
1079 use_shaders_for_blending = false; 1080 use_shaders_for_blending = false;
1080 } else if (background_image_id) { 1081 } else if (background_image_id) {
1081 // Reset original background texture if there is not any mask 1082 // Reset original background texture if there is not any mask
1082 if (!quad->mask_resource_id()) 1083 if (!quad->mask_resource_id())
(...skipping 2603 matching lines...) Expand 10 before | Expand all | Expand 10 after
3686 texture_id = pending_overlay_resources_.back()->texture_id(); 3687 texture_id = pending_overlay_resources_.back()->texture_id();
3687 } 3688 }
3688 3689
3689 context_support_->ScheduleOverlayPlane( 3690 context_support_->ScheduleOverlayPlane(
3690 overlay.plane_z_order, overlay.transform, texture_id, 3691 overlay.plane_z_order, overlay.transform, texture_id,
3691 ToNearestRect(overlay.display_rect), overlay.uv_rect); 3692 ToNearestRect(overlay.display_rect), overlay.uv_rect);
3692 } 3693 }
3693 } 3694 }
3694 3695
3695 } // namespace cc 3696 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698