Changeset 89700 in webkit
- Timestamp:
- Jun 24, 2011 1:46:42 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 9 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r89699 r89700 1 2011-06-24 Nat Duca <nduca@chromium.org> 2 3 Unreviewed, rolling out r89694. 4 http://trac.webkit.org/changeset/89694 5 https://bugs.webkit.org/show_bug.cgi?id=58408 6 7 Test shell still not ready for animate changes. 8 9 * WebCore.gypi: 10 * platform/graphics/chromium/LayerRendererChromium.cpp: 11 (WebCore::LayerRendererChromium::create): 12 (WebCore::LayerRendererChromium::LayerRendererChromium): 13 (WebCore::LayerRendererChromium::setViewport): 14 (WebCore::LayerRendererChromium::updateAndDrawLayers): 15 * platform/graphics/chromium/LayerRendererChromium.h: 16 * platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp: 17 * platform/graphics/chromium/cc/CCHeadsUpDisplay.h: 18 (WebCore::CCHeadsUpDisplay::setShowFPSCounter): 19 (WebCore::CCHeadsUpDisplay::setShowPlatformLayerTree): 20 * platform/graphics/chromium/cc/CCLayerTreeHost.cpp: Removed. 21 * platform/graphics/chromium/cc/CCLayerTreeHost.h: Removed. 22 * platform/graphics/chromium/cc/CCLayerTreeHostCommitter.cpp: Removed. 23 * platform/graphics/chromium/cc/CCLayerTreeHostCommitter.h: Removed. 24 * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp: Removed. 25 * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h: Removed. 26 * platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.cpp: Removed. 27 * platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.h: Removed. 28 * platform/graphics/chromium/cc/CCMainThreadTask.h: 29 * platform/graphics/chromium/cc/CCThread.cpp: 30 (WebCore::CCThread::runLoop): 31 * platform/graphics/chromium/cc/CCThreadTask.h: 32 1 33 2011-06-24 Chris Rogers <crogers@google.com> 2 34 -
trunk/Source/WebCore/WebCore.gypi
r89694 r89700 4168 4168 'platform/graphics/chromium/cc/CCLayerSorter.cpp', 4169 4169 'platform/graphics/chromium/cc/CCLayerSorter.h', 4170 'platform/graphics/chromium/cc/CCLayerTreeHost.cpp',4171 'platform/graphics/chromium/cc/CCLayerTreeHost.h',4172 'platform/graphics/chromium/cc/CCLayerTreeHostCommitter.cpp',4173 'platform/graphics/chromium/cc/CCLayerTreeHostCommitter.h',4174 'platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp',4175 'platform/graphics/chromium/cc/CCLayerTreeHostImpl.h',4176 'platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.cpp',4177 'platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.h',4178 4170 'platform/graphics/chromium/cc/CCMainThread.cpp', 4179 4171 'platform/graphics/chromium/cc/CCMainThread.h', -
trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
r89694 r89700 51 51 #include "WebGLLayerChromium.h" 52 52 #include "cc/CCLayerImpl.h" 53 #include "cc/CCLayerTreeHostImpl.h"54 #include "cc/CCMainThreadTask.h"55 53 #if USE(SKIA) 56 54 #include "Extensions3D.h" … … 101 99 } 102 100 103 PassRefPtr<LayerRendererChromium> LayerRendererChromium::create(CCLayerTreeHostClient* client, PassOwnPtr<LayerPainterChromium> contentPaint, bool accelerateDrawing) 104 { 105 RefPtr<GraphicsContext3D> context = client->createLayerTreeHostContext3D(); 101 PassRefPtr<LayerRendererChromium> LayerRendererChromium::create(PassRefPtr<GraphicsContext3D> context, PassOwnPtr<LayerPainterChromium> contentPaint, bool accelerateDrawing) 102 { 106 103 if (!context) 107 104 return 0; 108 105 109 RefPtr<LayerRendererChromium> layerRenderer(adoptRef(new LayerRendererChromium(client, context, contentPaint, accelerateDrawing))); 110 layerRenderer->init(); 106 RefPtr<LayerRendererChromium> layerRenderer(adoptRef(new LayerRendererChromium(context, contentPaint, accelerateDrawing))); 111 107 if (!layerRenderer->hardwareCompositing()) 112 108 return 0; … … 115 111 } 116 112 117 LayerRendererChromium::LayerRendererChromium(CCLayerTreeHostClient* client, 118 PassRefPtr<GraphicsContext3D> context, 113 LayerRendererChromium::LayerRendererChromium(PassRefPtr<GraphicsContext3D> context, 119 114 PassOwnPtr<LayerPainterChromium> contentPaint, 120 115 bool accelerateDrawing) 121 : CCLayerTreeHost(client) 122 , m_viewportScrollPosition(IntPoint(-1, -1)) 116 : m_viewportScrollPosition(IntPoint(-1, -1)) 123 117 , m_rootLayer(0) 124 118 , m_accelerateDrawing(false) … … 230 224 m_rootLayerContentTiler->invalidateEntireLayer(); 231 225 } 232 setNeedsCommitAndRedraw(); 233 } 234 235 void LayerRendererChromium::updateLayers() 236 { 237 CCLayerTreeHost::updateLayers(); 226 } 227 228 void LayerRendererChromium::updateAndDrawLayers() 229 { 238 230 if (m_viewportVisibleRect.isEmpty()) 239 231 return; … … 260 252 } 261 253 262 m_computedRenderSurfaceLayerList = adoptPtr(new LayerList()); 263 updateLayers(*m_computedRenderSurfaceLayerList); 264 } 265 266 void LayerRendererChromium::drawLayers() 267 { 268 ASSERT(m_hardwareCompositing); 269 ASSERT(m_computedRenderSurfaceLayerList); 254 LayerList renderSurfaceLayerList; 255 updateLayers(renderSurfaceLayerList); 256 270 257 // Before drawLayers: 271 258 if (hardwareCompositing() && m_contextSupportsLatch) { … … 290 277 } 291 278 292 drawLayers( *m_computedRenderSurfaceLayerList);279 drawLayers(renderSurfaceLayerList); 293 280 294 281 m_textureManager->unprotectAllTextures(); … … 1279 1266 } 1280 1267 1281 class LayerRendererChromiumImpl : public CCLayerTreeHostImpl {1282 public:1283 static PassOwnPtr<LayerRendererChromiumImpl> create(CCLayerTreeHostImplClient* client, LayerRendererChromium* layerRenderer)1284 {1285 return adoptPtr(new LayerRendererChromiumImpl(client, layerRenderer));1286 }1287 1288 virtual void drawLayersAndPresent()1289 {1290 CCCompletionEvent completion;1291 bool contextLost;1292 CCMainThread::postTask(createMainThreadTask(this, &LayerRendererChromiumImpl::drawLayersOnMainThread, AllowCrossThreadAccess(&completion), AllowCrossThreadAccess(&contextLost)));1293 completion.wait();1294 1295 // FIXME: Send the "UpdateRect" message up to the RenderWidget [or moveplugin equivalents...]1296 1297 // FIXME: handle context lost1298 if (contextLost)1299 FATAL("LayerRendererChromiumImpl does not handle context lost yet.");1300 }1301 1302 private:1303 LayerRendererChromiumImpl(CCLayerTreeHostImplClient* client, LayerRendererChromium* layerRenderer)1304 : CCLayerTreeHostImpl(client)1305 , m_layerRenderer(layerRenderer) { }1306 1307 void drawLayersOnMainThread(CCCompletionEvent* completion, bool* contextLost)1308 {1309 ASSERT(isMainThread());1310 1311 if (m_layerRenderer->rootLayer()) {1312 m_layerRenderer->drawLayers();1313 m_layerRenderer->present();1314 1315 GraphicsContext3D* context = m_layerRenderer->context();1316 *contextLost = context->getExtensions()->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR;1317 } else1318 *contextLost = false;1319 completion->signal();1320 }1321 1322 LayerRendererChromium* m_layerRenderer;1323 };1324 1325 class LayerRendererChromiumImplProxy : public CCLayerTreeHostImplProxy {1326 public:1327 static PassOwnPtr<LayerRendererChromiumImplProxy> create(LayerRendererChromium* layerRenderer)1328 {1329 return adoptPtr(new LayerRendererChromiumImplProxy(layerRenderer));1330 }1331 1332 virtual PassOwnPtr<CCLayerTreeHostImpl> createLayerTreeHostImpl()1333 {1334 return LayerRendererChromiumImpl::create(this, static_cast<LayerRendererChromium*>(host()));1335 }1336 1337 private:1338 LayerRendererChromiumImplProxy(LayerRendererChromium* layerRenderer)1339 : CCLayerTreeHostImplProxy(layerRenderer) { }1340 };1341 1342 PassOwnPtr<CCLayerTreeHostImplProxy> LayerRendererChromium::createLayerTreeHostImplProxy()1343 {1344 OwnPtr<CCLayerTreeHostImplProxy> proxy = LayerRendererChromiumImplProxy::create(this);1345 proxy->start();1346 return proxy.release();1347 }1348 1349 1268 } // namespace WebCore 1350 1269 -
trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h
r89694 r89700 45 45 #include "cc/CCHeadsUpDisplay.h" 46 46 #include "cc/CCLayerSorter.h" 47 #include "cc/CCLayerTreeHost.h"48 47 #include "cc/CCPluginLayerImpl.h" 49 48 #include "cc/CCVideoLayerImpl.h" … … 52 51 #include <wtf/PassOwnPtr.h> 53 52 #include <wtf/PassRefPtr.h> 53 #include <wtf/RefCounted.h> 54 54 #include <wtf/Vector.h> 55 55 … … 67 67 class CCHeadsUpDisplay; 68 68 class CCLayerImpl; 69 class CCLayerTreeHostCommitter;70 class CCLayerTreeHostImpl;71 69 class GeometryBinding; 72 70 class GraphicsContext3D; … … 74 72 75 73 // Class that handles drawing of composited render layers using GL. 76 class LayerRendererChromium : public CCLayerTreeHost{74 class LayerRendererChromium : public RefCounted<LayerRendererChromium> { 77 75 public: 78 static PassRefPtr<LayerRendererChromium> create( CCLayerTreeHostClient*, PassOwnPtr<LayerPainterChromium> contentPaint, bool accelerateDrawing);76 static PassRefPtr<LayerRendererChromium> create(PassRefPtr<GraphicsContext3D>, PassOwnPtr<LayerPainterChromium> contentPaint, bool accelerateDrawing); 79 77 80 78 ~LayerRendererChromium(); … … 91 89 92 90 // updates and draws the current layers onto the backbuffer 93 virtual void updateLayers(); 94 void drawLayers(); 91 void updateAndDrawLayers(); 95 92 96 93 // Set by WebViewImpl when animation callbacks are running. … … 160 157 static bool s_inPaintLayerContents; 161 158 #endif 162 protected:163 virtual PassOwnPtr<CCLayerTreeHostImplProxy> createLayerTreeHostImplProxy();164 165 159 private: 166 160 typedef Vector<RefPtr<CCLayerImpl> > LayerList; 167 161 typedef HashMap<GraphicsContext3D*, int> ChildContextMap; 168 162 169 // FIXME: This needs to be moved to the CC LayerTreeHostImpl when that class exists.163 // FIXME: This needs to be moved to the CCViewImpl when that class exists. 170 164 RefPtr<CCLayerImpl> m_rootCCLayerImpl; 171 165 172 LayerRendererChromium( CCLayerTreeHostClient*,PassRefPtr<GraphicsContext3D>, PassOwnPtr<LayerPainterChromium> contentPaint, bool accelerateDrawing);166 LayerRendererChromium(PassRefPtr<GraphicsContext3D>, PassOwnPtr<LayerPainterChromium> contentPaint, bool accelerateDrawing); 173 167 174 168 void updateLayers(LayerList& renderSurfaceLayerList); … … 216 210 bool m_hardwareCompositing; 217 211 bool m_accelerateDrawing; 218 219 OwnPtr<LayerList> m_computedRenderSurfaceLayerList;220 212 221 213 RenderSurfaceChromium* m_currentRenderSurface; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp
r89694 r89700 248 248 } 249 249 250 void CCHeadsUpDisplay::setShowFPSCounter(bool show)251 {252 m_showFPSCounter = show;253 m_layerRenderer->setNeedsRedraw();254 }255 256 void CCHeadsUpDisplay::setShowPlatformLayerTree(bool show)257 {258 m_showPlatformLayerTree = show;259 m_layerRenderer->setNeedsRedraw();260 }261 262 250 } 263 251 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplay.h
r89694 r89700 50 50 ~CCHeadsUpDisplay(); 51 51 52 int currentFrameNumber() const { return m_currentFrameNumber; }53 54 52 void onFrameBegin(double timestamp); 55 53 void onPresent(); 56 54 57 void setShowFPSCounter(bool enable) ;55 void setShowFPSCounter(bool enable) { m_showFPSCounter = enable; } 58 56 bool showFPSCounter() const { return m_showFPSCounter; } 59 57 60 void setShowPlatformLayerTree(bool enable) ;58 void setShowPlatformLayerTree(bool enable) { m_showPlatformLayerTree = enable; } 61 59 bool showPlatformLayerTree() const { return m_showPlatformLayerTree; } 62 60 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCMainThreadTask.h
r89694 r89700 25 25 #define CCMainThreadTask_h 26 26 27 #include "CCMainThread.h" 27 28 #include "CrossThreadCopier.h" 28 29 #include "CrossThreadTask.h" 29 #include "cc/CCMainThread.h"30 30 #include <wtf/PassOwnPtr.h> 31 31 #include <wtf/PassRefPtr.h> -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCThread.cpp
r89694 r89700 28 28 29 29 #include "LayerRendererChromium.h" 30 #include "TraceEvent.h"31 30 #include <wtf/CurrentTime.h> 32 31 #include <wtf/PassOwnPtr.h> … … 66 65 void* CCThread::runLoop() 67 66 { 68 TRACE_EVENT("CCThread::runLoop", this, 0);69 67 { 70 68 // Wait for CCThread::start() to complete to have m_threadID -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadTask.h
r89694 r89700 25 25 #define CCThreadTask_h 26 26 27 #include "CCThread.h" 27 28 #include "CrossThreadCopier.h" 28 29 #include "CrossThreadTask.h" 29 #include "cc/CCThread.h"30 30 #include <wtf/PassOwnPtr.h> 31 31 #include <wtf/PassRefPtr.h> -
trunk/Source/WebKit/chromium/ChangeLog
r89694 r89700 1 2011-06-24 Nat Duca <nduca@chromium.org> 2 3 Unreviewed, rolling out r89694. 4 http://trac.webkit.org/changeset/89694 5 https://bugs.webkit.org/show_bug.cgi?id=58408 6 7 Test shell still not ready for animate changes. 8 9 * WebKit.gypi: 10 * public/WebWidget.h: 11 (WebKit::WebWidget::animate): 12 (WebKit::WebWidget::composite): 13 * src/WebPopupMenuImpl.cpp: 14 (WebKit::WebPopupMenuImpl::animate): 15 * src/WebPopupMenuImpl.h: 16 * src/WebViewImpl.cpp: 17 (WebKit::WebViewImpl::resize): 18 (WebKit::WebViewImpl::animate): 19 (WebKit::WebViewImpl::paint): 20 (WebKit::WebViewImpl::composite): 21 (WebKit::WebViewImpl::fullFramePluginZoomLevelChanged): 22 (WebKit::WebView::zoomLevelToZoomFactor): 23 (WebKit::WebViewImpl::setRootLayerNeedsDisplay): 24 (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): 25 (WebKit::WebViewImpl::doComposite): 26 (WebKit::WebViewImpl::reallocateRenderer): 27 (WebKit::WebViewImpl::updateLayerRendererViewport): 28 (WebKit::WebViewImpl::graphicsContext3D): 29 * src/WebViewImpl.h: 30 * tests/CCLayerTreeHostTest.cpp: Removed. 31 * tests/CCThreadTest.cpp: 32 (WebCore::TEST): 33 1 34 2011-05-17 Nat Duca <nduca@chromium.org> 2 35 -
trunk/Source/WebKit/chromium/WebKit.gypi
r89694 r89700 55 55 'tests/ArenaTestHelpers.h', 56 56 'tests/AssociatedURLLoaderTest.cpp', 57 'tests/ CCLayerTreeHostTest.cpp',57 'tests/InnerGestureRecognizerTest.cpp', 58 58 'tests/CCThreadTaskTest.cpp', 59 59 'tests/CCThreadTest.cpp', … … 61 61 'tests/IDBKeyPathTest.cpp', 62 62 'tests/IDBLevelDBCodingTest.cpp', 63 'tests/InnerGestureRecognizerTest.cpp',64 63 'tests/KeyboardTest.cpp', 65 64 'tests/KURLTest.cpp', -
trunk/Source/WebKit/chromium/public/WebWidget.h
r89694 r89700 48 48 template <typename T> class WebVector; 49 49 50 // FIXME: remove this define once render_widget has been changed to issue threaded compositor calls51 #define WEBWIDGET_HAS_ANIMATE_CHANGES 152 53 50 class WebWidget { 54 51 public: … … 72 69 virtual void willEndLiveResize() { } 73 70 74 // Called to update imperative animation state. This should be called before 75 // paint, although the client can rate-limit these calls. When 76 // frameBeginTime is 0.0, the WebWidget will determine the frame begin time 77 // itself. 78 virtual void animate(double frameBeginTime) { } 71 // Called to update imperative animation state. This should be called before 72 // paint, although the client can rate-limit these calls. 73 virtual void animate() { } 79 74 80 75 // Called to layout the WebWidget. This MUST be called before Paint, … … 82 77 virtual void layout() { } 83 78 84 // Called to paint the rectangular region within the WebWidget 79 // Called to paint the rectangular region within the WebWidget 85 80 // onto the specified canvas at (viewPort.x,viewPort.y). You MUST call 86 81 // Layout before calling this method. It is okay to call paint … … 91 86 virtual void paint(WebCanvas*, const WebRect& viewPort) { } 92 87 93 // In non-threaded compositing mode, triggers compositing of the current 94 // layers onto the screen. You MUST call Layout before calling this method, for the same 95 // reasons described in the paint method above 96 // 97 // In threaded compositing mode, indicates that the widget should update 98 // itself, for example due to window damage. The redraw will begin 99 // asynchronously and perform layout and animation internally. Do not call 100 // animate or layout in this case. 101 virtual void composite(bool finish) = 0; 88 // Triggers compositing of the current layers onto the screen. 89 // The finish argument controls whether the compositor will wait for the 90 // GPU to finish rendering before returning. You MUST call Layout 91 // before calling this method, for the same reasons described in 92 // the paint method above. 93 virtual void composite(bool finish) { } 102 94 103 95 // Called to inform the WebWidget of a change in theme. -
trunk/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp
r89694 r89700 168 168 } 169 169 170 void WebPopupMenuImpl::animate( double)170 void WebPopupMenuImpl::animate() 171 171 { 172 172 } -
trunk/Source/WebKit/chromium/src/WebPopupMenuImpl.h
r89694 r89700 66 66 virtual void resize(const WebSize&); 67 67 virtual void willEndLiveResize(); 68 virtual void animate( double frameBeginTime);68 virtual void animate(); 69 69 virtual void layout(); 70 70 virtual void paint(WebCanvas* canvas, const WebRect& rect); -
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
r89694 r89700 149 149 150 150 using namespace WebCore; 151 using namespace std;152 151 153 152 namespace { … … 1006 1005 #if USE(ACCELERATED_COMPOSITING) 1007 1006 if (m_layerRenderer && isAcceleratedCompositingActive()) { 1008 m_layerRenderer->resizeOnscreenContent(IntSize( max(1, m_size.width),1009 max(1, m_size.height)));1007 m_layerRenderer->resizeOnscreenContent(IntSize(std::max(1, m_size.width), 1008 std::max(1, m_size.height))); 1010 1009 } 1011 1010 #endif … … 1018 1017 } 1019 1018 1020 void WebViewImpl::animate(double frameBeginTime) 1021 { 1019 void WebViewImpl::animate() 1020 { 1021 TRACE_EVENT("WebViewImpl::animate", this, 0); 1022 1022 #if ENABLE(REQUEST_ANIMATION_FRAME) 1023 TRACE_EVENT("WebViewImpl::animate", this, 0);1024 // FIXME: remove this zero-check once render_widget has been modified to1025 // pass in a frameBeginTime.1026 if (!frameBeginTime)1027 frameBeginTime = currentTime();1028 1023 WebFrameImpl* webframe = mainFrameImpl(); 1029 1024 if (webframe) { … … 1032 1027 if (m_layerRenderer) 1033 1028 m_layerRenderer->setIsAnimating(true); 1034 view->serviceScriptedAnimations(convertSecondsToDOMTimeStamp( frameBeginTime));1029 view->serviceScriptedAnimations(convertSecondsToDOMTimeStamp(currentTime())); 1035 1030 if (m_layerRenderer) 1036 1031 m_layerRenderer->setIsAnimating(false); … … 1101 1096 if (isAcceleratedCompositingActive()) { 1102 1097 #if USE(ACCELERATED_COMPOSITING) 1103 #if USE(THREADED_COMPOSITING)1104 // FIXME: do readback in threaded compositing mode rather than returning nothing1105 return;1106 #endif1107 1098 doComposite(); 1108 1099 … … 1138 1129 } 1139 1130 1140 void WebViewImpl::animateAndLayout(double frameBeginTime) 1141 { 1142 animate(frameBeginTime); 1143 layout(); 1144 } 1145 1146 void WebViewImpl::updateLayers() 1147 { 1131 void WebViewImpl::composite(bool finish) 1132 { 1133 #if USE(ACCELERATED_COMPOSITING) 1148 1134 // Update the compositing requirements for all frame in the tree before doing any painting 1149 1135 // as the compositing requirements for a RenderLayer within a subframe might change. … … 1151 1137 frame->view()->updateCompositingLayers(); 1152 1138 page()->mainFrame()->view()->syncCompositingStateIncludingSubframes(); 1153 } 1154 1155 void WebViewImpl::composite(bool finish) 1156 { 1157 #if USE(ACCELERATED_COMPOSITING) 1158 #if USE(THREADED_COMPOSITING) 1159 m_layerRenderer->setNeedsRedraw(); 1160 #else 1139 1161 1140 TRACE_EVENT("WebViewImpl::composite", this, 0); 1162 1163 1141 if (m_recreatingGraphicsContext) { 1164 1142 // reallocateRenderer will request a repaint whether or not it succeeded … … 1169 1147 } 1170 1148 doComposite(); 1149 1150 // Finish if requested. 1151 if (finish) 1152 m_layerRenderer->finish(); 1171 1153 1172 1154 // Put result onscreen. … … 1183 1165 setRootLayerNeedsDisplay(); 1184 1166 } 1185 #endif1186 1167 #endif 1187 1168 } … … 1798 1779 return; 1799 1780 1800 m_zoomLevel = max(min(zoomLevel, m_maximumZoomLevel), m_minimumZoomLevel);1781 m_zoomLevel = std::max(std::min(zoomLevel, m_maximumZoomLevel), m_minimumZoomLevel); 1801 1782 m_client->zoomLevelChanged(); 1802 1783 } … … 1804 1785 double WebView::zoomLevelToZoomFactor(double zoomLevel) 1805 1786 { 1806 return pow(textSizeMultiplierRatio, zoomLevel);1787 return std::pow(textSizeMultiplierRatio, zoomLevel); 1807 1788 } 1808 1789 … … 2438 2419 void WebViewImpl::setRootLayerNeedsDisplay() 2439 2420 { 2440 #if USE(THREADED_COMPOSITING)2441 if (m_layerRenderer)2442 m_layerRenderer->setNeedsCommitAndRedraw();2443 #else2444 2421 m_client->scheduleComposite(); 2445 #endif2446 2422 } 2447 2423 … … 2515 2491 } else if (m_layerRenderer) { 2516 2492 m_isAcceleratedCompositingActive = true; 2517 m_layerRenderer->resizeOnscreenContent(WebCore::IntSize( max(1, m_size.width),2518 max(1, m_size.height)));2493 m_layerRenderer->resizeOnscreenContent(WebCore::IntSize(std::max(1, m_size.width), 2494 std::max(1, m_size.height))); 2519 2495 2520 2496 m_client->didActivateAcceleratedCompositing(true); 2521 2497 } else { 2522 2498 TRACE_EVENT("WebViewImpl::setIsAcceleratedCompositingActive(true)", this, 0); 2523 2524 m_layerRenderer = LayerRendererChromium::create(this, WebViewImplContentPainter::create(this), m_page->settings()->acceleratedDrawingEnabled()); 2499 RefPtr<GraphicsContext3D> context = m_temporaryOnscreenGraphicsContext3D.release(); 2500 if (!context) { 2501 context = GraphicsContext3D::create(getCompositorContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); 2502 if (context) 2503 context->reshape(std::max(1, m_size.width), std::max(1, m_size.height)); 2504 } 2505 2506 2507 m_layerRenderer = LayerRendererChromium::create(context.release(), WebViewImplContentPainter::create(this), m_page->settings()->acceleratedDrawingEnabled()); 2525 2508 if (m_layerRenderer) { 2526 updateLayerRendererSettings();2527 2509 m_client->didActivateAcceleratedCompositing(true); 2528 2510 m_isAcceleratedCompositingActive = true; … … 2552 2534 return; 2553 2535 2536 m_layerRenderer->setCompositeOffscreen(settings()->compositeToTextureEnabled()); 2537 2538 CCHeadsUpDisplay* hud = m_layerRenderer->headsUpDisplay(); 2539 hud->setShowFPSCounter(settings()->showFPSCounter()); 2540 hud->setShowPlatformLayerTree(settings()->showPlatformLayerTree()); 2541 2554 2542 if (m_pageOverlay) 2555 2543 m_pageOverlay->update(); 2556 2544 2557 m_layerRenderer->updateLayers(); 2558 m_layerRenderer->drawLayers(); 2559 } 2560 2561 PassRefPtr<GraphicsContext3D> WebViewImpl::createLayerTreeHostContext3D() 2562 { 2563 RefPtr<GraphicsContext3D> context = m_temporaryOnscreenGraphicsContext3D.release(); 2564 if (!context) { 2565 context = GraphicsContext3D::create(getCompositorContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); 2566 if (context) 2567 context->reshape(max(1, m_size.width), max(1, m_size.height)); 2568 } 2569 return context; 2545 m_layerRenderer->updateAndDrawLayers(); 2570 2546 } 2571 2547 2572 2548 void WebViewImpl::reallocateRenderer() 2573 2549 { 2550 RefPtr<GraphicsContext3D> newContext = m_temporaryOnscreenGraphicsContext3D.get(); 2551 WebGraphicsContext3D* webContext = GraphicsContext3DInternal::extractWebGraphicsContext3D(newContext.get()); 2552 if (!newContext || !webContext || webContext->isContextLost()) 2553 newContext = GraphicsContext3D::create( 2554 getCompositorContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); 2574 2555 // GraphicsContext3D::create might fail and return 0, in that case LayerRendererChromium::create will also return 0. 2575 RefPtr<LayerRendererChromium> layerRenderer = LayerRendererChromium::create( this, WebViewImplContentPainter::create(this), m_page->settings()->acceleratedDrawingEnabled());2556 RefPtr<LayerRendererChromium> layerRenderer = LayerRendererChromium::create(newContext, WebViewImplContentPainter::create(this), m_page->settings()->acceleratedDrawingEnabled()); 2576 2557 2577 2558 // Reattach the root layer. Child layers will get reattached as a side effect of updateLayersRecursive. … … 2579 2560 m_layerRenderer->transferRootLayer(layerRenderer.get()); 2580 2561 m_layerRenderer = layerRenderer; 2581 updateLayerRendererSettings();2582 2583 2562 // FIXME: In MacOS newContext->reshape method needs to be called to 2584 2563 // allocate IOSurfaces. All calls to create a context followed by … … 2586 2565 // immediately obvious that GraphicsContext3D object will not 2587 2566 // function properly until its reshape method is called. 2588 layerRenderer->context()->reshape(max(1, m_size.width),max(1, m_size.height));2567 newContext->reshape(std::max(1, m_size.width), std::max(1, m_size.height)); 2589 2568 setRootPlatformLayer(m_layerRenderer->rootLayer()); 2590 2591 2569 // Forces ViewHostMsg_DidActivateAcceleratedCompositing to be sent so 2592 2570 // that the browser process can reacquire surfaces. … … 2599 2577 #endif 2600 2578 2601 void WebViewImpl::updateLayerRenderer Settings()2579 void WebViewImpl::updateLayerRendererViewport() 2602 2580 { 2603 2581 ASSERT(m_layerRenderer); 2604 m_layerRenderer->setCompositeOffscreen(settings()->compositeToTextureEnabled()); 2605 2606 CCHeadsUpDisplay* hud = m_layerRenderer->headsUpDisplay(); 2607 hud->setShowFPSCounter(settings()->showFPSCounter()); 2608 hud->setShowPlatformLayerTree(settings()->showPlatformLayerTree()); 2609 } 2610 2611 void WebViewImpl::updateLayerRendererViewport() 2612 { 2582 2613 2583 if (!page()) 2614 2584 return; … … 2638 2608 m_temporaryOnscreenGraphicsContext3D = GraphicsContext3D::create(getCompositorContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); 2639 2609 if (m_temporaryOnscreenGraphicsContext3D) 2640 m_temporaryOnscreenGraphicsContext3D->reshape( max(1, m_size.width),max(1, m_size.height));2610 m_temporaryOnscreenGraphicsContext3D->reshape(std::max(1, m_size.width), std::max(1, m_size.height)); 2641 2611 return GraphicsContext3DInternal::extractWebGraphicsContext3D(m_temporaryOnscreenGraphicsContext3D.get()); 2642 2612 } -
trunk/Source/WebKit/chromium/src/WebViewImpl.h
r89694 r89700 57 57 class DocumentLoader; 58 58 class Frame; 59 class GraphicsContext3D;60 59 class HistoryItem; 61 60 class HitTestResult; … … 89 88 class WebTouchEvent; 90 89 91 class WebViewImpl : public WebView, public WebCore::CCLayerTreeHostClient, publicRefCounted<WebViewImpl> {90 class WebViewImpl : public WebView, public RefCounted<WebViewImpl> { 92 91 public: 93 92 // WebWidget methods: … … 97 96 virtual void resize(const WebSize&); 98 97 virtual void willEndLiveResize(); 99 virtual void animate( double frameBeginTime);98 virtual void animate(); 100 99 virtual void layout(); 101 100 virtual void paint(WebCanvas*, const WebRect&); … … 204 203 virtual void performCustomContextMenuAction(unsigned action); 205 204 206 // CCLayerTreeHostClient207 virtual void animateAndLayout(double frameBeginTime);208 virtual PassRefPtr<WebCore::GraphicsContext3D> createLayerTreeHostContext3D();209 virtual void updateLayers();210 211 205 // WebViewImpl 212 206 … … 363 357 void scrollRootLayerRect(const WebCore::IntSize& scrollDelta, const WebCore::IntRect& clipRect); 364 358 void invalidateRootLayerRect(const WebCore::IntRect&); 365 void doUpdateAndComposite();366 359 #endif 367 360 … … 431 424 void doPixelReadbackToCanvas(WebCanvas*, const WebCore::IntRect&); 432 425 void reallocateRenderer(); 433 void updateLayerRendererSettings();434 426 void updateLayerRendererViewport(); 435 427 #endif -
trunk/Source/WebKit/chromium/tests/CCThreadTest.cpp
r89694 r89700 54 54 PingPongUsingCondition target; 55 55 CCCompletionEvent completion; 56 thread->postTask(createCCThreadTask(&target, &PingPongUsingCondition::ping, 56 thread->postTask(createCCThreadTask(&target, &PingPongUsingCondition::ping, 57 57 AllowCrossThreadAccess(&completion))); 58 58 completion.wait(); -
trunk/Tools/ChangeLog
r89698 r89700 1 2011-06-24 Nat Duca <nduca@chromium.org> 2 3 Unreviewed, rolling out r89694. 4 http://trac.webkit.org/changeset/89694 5 https://bugs.webkit.org/show_bug.cgi?id=58408 6 7 Test shell still not ready for animate changes. 8 9 * DumpRenderTree/chromium/WebViewHost.cpp: 10 (WebViewHost::paintInvalidatedRegion): 11 1 12 2011-06-24 Adam Roben <aroben@apple.com> 2 13 -
trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp
r89694 r89700 1487 1487 { 1488 1488 #if ENABLE(REQUEST_ANIMATION_FRAME) 1489 webWidget()->animate( 0.0);1489 webWidget()->animate(); 1490 1490 #endif 1491 1491 webWidget()->layout();
Note: See TracChangeset
for help on using the changeset viewer.