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

Side by Side Diff: cc/layers/io_surface_layer_impl.cc

Issue 1062043003: cc: Add ResourceId validation checks at the time of AppendQuads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resource-validate: fixtests Created 5 years, 8 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 | « cc/layers/heads_up_display_layer_impl.cc ('k') | cc/layers/io_surface_layer_impl_unittest.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/layers/io_surface_layer_impl.h" 5 #include "cc/layers/io_surface_layer_impl.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "cc/output/output_surface.h" 8 #include "cc/output/output_surface.h"
9 #include "cc/quads/io_surface_draw_quad.h" 9 #include "cc/quads/io_surface_draw_quad.h"
10 #include "cc/trees/layer_tree_impl.h" 10 #include "cc/trees/layer_tree_impl.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 render_pass, content_bounds(), shared_quad_state, append_quads_data); 70 render_pass, content_bounds(), shared_quad_state, append_quads_data);
71 71
72 gfx::Rect quad_rect(content_bounds()); 72 gfx::Rect quad_rect(content_bounds());
73 gfx::Rect opaque_rect(contents_opaque() ? quad_rect : gfx::Rect()); 73 gfx::Rect opaque_rect(contents_opaque() ? quad_rect : gfx::Rect());
74 gfx::Rect visible_quad_rect = 74 gfx::Rect visible_quad_rect =
75 draw_properties().occlusion_in_content_space.GetUnoccludedContentRect( 75 draw_properties().occlusion_in_content_space.GetUnoccludedContentRect(
76 quad_rect); 76 quad_rect);
77 if (visible_quad_rect.IsEmpty()) 77 if (visible_quad_rect.IsEmpty())
78 return; 78 return;
79 79
80 // TODO(danakj): crbug.com/455931
81 layer_tree_impl()->resource_provider()->ValidateResource(
82 io_surface_resource_id_);
80 IOSurfaceDrawQuad* quad = 83 IOSurfaceDrawQuad* quad =
81 render_pass->CreateAndAppendDrawQuad<IOSurfaceDrawQuad>(); 84 render_pass->CreateAndAppendDrawQuad<IOSurfaceDrawQuad>();
82 quad->SetNew(shared_quad_state, 85 quad->SetNew(shared_quad_state,
83 quad_rect, 86 quad_rect,
84 opaque_rect, 87 opaque_rect,
85 visible_quad_rect, 88 visible_quad_rect,
86 io_surface_size_, 89 io_surface_size_,
87 io_surface_resource_id_, 90 io_surface_resource_id_,
88 IOSurfaceDrawQuad::FLIPPED); 91 IOSurfaceDrawQuad::FLIPPED);
89 } 92 }
(...skipping 12 matching lines...) Expand all
102 105
103 io_surface_id_ = io_surface_id; 106 io_surface_id_ = io_surface_id;
104 io_surface_size_ = size; 107 io_surface_size_ = size;
105 } 108 }
106 109
107 const char* IOSurfaceLayerImpl::LayerTypeAsString() const { 110 const char* IOSurfaceLayerImpl::LayerTypeAsString() const {
108 return "cc::IOSurfaceLayerImpl"; 111 return "cc::IOSurfaceLayerImpl";
109 } 112 }
110 113
111 } // namespace cc 114 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/heads_up_display_layer_impl.cc ('k') | cc/layers/io_surface_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698