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

Side by Side Diff: Source/web/PageOverlayList.cpp

Issue 867063004: [Slimming Paint] Paint the inspector overlay with GraphicsLayer DisplayList. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 10 *
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 } 107 }
108 108
109 void PageOverlayList::update() 109 void PageOverlayList::update()
110 { 110 {
111 for (size_t i = 0; i < m_pageOverlays.size(); ++i) 111 for (size_t i = 0; i < m_pageOverlays.size(); ++i)
112 m_pageOverlays[i]->update(); 112 m_pageOverlays[i]->update();
113 } 113 }
114 114
115 void PageOverlayList::paintWebFrame(GraphicsContext& gc) 115 void PageOverlayList::paintWebFrame(GraphicsContext& gc)
116 { 116 {
117 // If accelerated compositing is active, page overlays are painted through
118 // their corresponding GraphicsLayer.
119 ASSERT(!m_viewImpl->isAcceleratedCompositingActive());
117 for (size_t i = 0; i < m_pageOverlays.size(); ++i) 120 for (size_t i = 0; i < m_pageOverlays.size(); ++i)
118 m_pageOverlays[i]->paintWebFrame(gc); 121 m_pageOverlays[i]->paintWebFrame(gc);
119 } 122 }
120 123
121 size_t PageOverlayList::find(WebPageOverlay* overlay) 124 size_t PageOverlayList::find(WebPageOverlay* overlay)
122 { 125 {
123 for (size_t i = 0; i < m_pageOverlays.size(); ++i) { 126 for (size_t i = 0; i < m_pageOverlays.size(); ++i) {
124 if (m_pageOverlays[i]->overlay() == overlay) 127 if (m_pageOverlays[i]->overlay() == overlay)
125 return i; 128 return i;
126 } 129 }
127 return WTF::kNotFound; 130 return WTF::kNotFound;
128 } 131 }
129 132
130 size_t PageOverlayList::findGraphicsLayer(GraphicsLayer* layer) 133 size_t PageOverlayList::findGraphicsLayer(GraphicsLayer* layer)
131 { 134 {
132 for (size_t i = 0; i < m_pageOverlays.size(); ++i) { 135 for (size_t i = 0; i < m_pageOverlays.size(); ++i) {
133 if (m_pageOverlays[i]->graphicsLayer() == layer) 136 if (m_pageOverlays[i]->graphicsLayer() == layer)
134 return i; 137 return i;
135 } 138 }
136 return WTF::kNotFound; 139 return WTF::kNotFound;
137 } 140 }
138 141
142 GraphicsLayer* PageOverlayList::graphicsLayerForTesting() const
143 {
144 if (m_pageOverlays.isEmpty())
145 return nullptr;
146 return m_pageOverlays[0]->graphicsLayer();
147 }
148
139 } // namespace blink 149 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698