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

Unified Diff: cc/output/overlay_strategy_single_on_top.cc

Issue 448303002: Use custom ListContainer to allocate DrawQuads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@perftest
Patch Set: change header files to try fix compile error Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/output/gl_renderer.cc ('k') | cc/output/overlay_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/overlay_strategy_single_on_top.cc
diff --git a/cc/output/overlay_strategy_single_on_top.cc b/cc/output/overlay_strategy_single_on_top.cc
index 64ebf7c5c5e7b4cec738e427e9256ff2ab6e54c1..6ac96b2d7a442bb7aa611c0b8042b76f0ff468cd 100644
--- a/cc/output/overlay_strategy_single_on_top.cc
+++ b/cc/output/overlay_strategy_single_on_top.cc
@@ -28,9 +28,9 @@ bool OverlayStrategySingleOnTop::Attempt(
DCHECK(root_render_pass);
QuadList& quad_list = root_render_pass->quad_list;
- QuadList::iterator candidate_iterator = quad_list.end();
- for (QuadList::iterator it = quad_list.begin(); it != quad_list.end(); ++it) {
- const DrawQuad* draw_quad = *it;
+ QuadList::Iterator candidate_iterator = quad_list.end();
+ for (QuadList::Iterator it = quad_list.begin(); it != quad_list.end(); ++it) {
+ const DrawQuad* draw_quad = &*it;
if (draw_quad->material == DrawQuad::TEXTURE_CONTENT) {
const TextureDrawQuad& quad = *TextureDrawQuad::MaterialCast(draw_quad);
if (!resource_provider_->AllowOverlay(quad.resource_id)) {
@@ -40,11 +40,11 @@ bool OverlayStrategySingleOnTop::Attempt(
bool intersects = false;
gfx::RectF rect = draw_quad->rect;
draw_quad->quadTransform().TransformRect(&rect);
- for (QuadList::iterator overlap_iter = quad_list.begin();
+ for (QuadList::Iterator overlap_iter = quad_list.begin();
overlap_iter != it;
++overlap_iter) {
- gfx::RectF overlap_rect = (*overlap_iter)->rect;
- (*overlap_iter)->quadTransform().TransformRect(&overlap_rect);
+ gfx::RectF overlap_rect = overlap_iter->rect;
+ overlap_iter->quadTransform().TransformRect(&overlap_rect);
if (rect.Intersects(overlap_rect)) {
intersects = true;
break;
@@ -59,7 +59,7 @@ bool OverlayStrategySingleOnTop::Attempt(
if (candidate_iterator == quad_list.end())
return false;
const TextureDrawQuad& quad =
- *TextureDrawQuad::MaterialCast(*candidate_iterator);
+ *TextureDrawQuad::MaterialCast(&*candidate_iterator);
// Simple quads only.
gfx::OverlayTransform overlay_transform =
@@ -94,7 +94,7 @@ bool OverlayStrategySingleOnTop::Attempt(
// If the candidate can be handled by an overlay, create a pass for it.
if (candidates[1].overlay_handled) {
- quad_list.erase(candidate_iterator);
+ quad_list.EraseAndInvalidateAllPointers(candidate_iterator);
candidate_list->swap(candidates);
return true;
}
« no previous file with comments | « cc/output/gl_renderer.cc ('k') | cc/output/overlay_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698