summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/chromium')
-rw-r--r--Source/WebKit/chromium/ChangeLog558
-rw-r--r--Source/WebKit/chromium/DEPS2
-rw-r--r--Source/WebKit/chromium/WebKit.grd30
-rw-r--r--Source/WebKit/chromium/WebKit.gypi1
-rw-r--r--Source/WebKit/chromium/features.gypi11
-rw-r--r--Source/WebKit/chromium/public/WebFrameClient.h9
-rw-r--r--Source/WebKit/chromium/public/WebIDBCallbacks.h2
-rw-r--r--Source/WebKit/chromium/public/WebIDBDatabaseCallbacks.h1
-rw-r--r--Source/WebKit/chromium/public/WebIDBFactory.h10
-rw-r--r--Source/WebKit/chromium/public/WebInputEvent.h2
-rw-r--r--Source/WebKit/chromium/public/WebPermissionClient.h3
-rw-r--r--Source/WebKit/chromium/public/WebRuntimeFeatures.h15
-rw-r--r--Source/WebKit/chromium/public/WebView.h13
-rw-r--r--Source/WebKit/chromium/public/WebViewBenchmarkSupport.h13
-rw-r--r--Source/WebKit/chromium/public/WebWidget.h5
-rw-r--r--Source/WebKit/chromium/scripts/generate_devtools_extension_api.py2
-rw-r--r--Source/WebKit/chromium/src/AssertMatchingEnums.cpp3
-rw-r--r--Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp2
-rw-r--r--Source/WebKit/chromium/src/IDBCallbacksProxy.cpp4
-rw-r--r--Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp5
-rw-r--r--Source/WebKit/chromium/src/IDBCursorBackendProxy.h1
-rwxr-xr-xSource/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp8
-rw-r--r--Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h1
-rw-r--r--Source/WebKit/chromium/src/LocalFileSystemChromium.cpp21
-rw-r--r--Source/WebKit/chromium/src/WebFrameImpl.cpp4
-rw-r--r--Source/WebKit/chromium/src/WebIDBCursorImpl.cpp5
-rw-r--r--Source/WebKit/chromium/src/WebIDBCursorImpl.h1
-rw-r--r--Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp1
-rwxr-xr-xSource/WebKit/chromium/src/WebIDBFactoryImpl.cpp7
-rw-r--r--Source/WebKit/chromium/src/WebIDBFactoryImpl.h1
-rwxr-xr-xSource/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp5
-rw-r--r--Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h1
-rw-r--r--Source/WebKit/chromium/src/WebIDBTransactionImpl.cpp1
-rw-r--r--Source/WebKit/chromium/src/WebInputEvent.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebLayerTreeView.cpp3
-rw-r--r--Source/WebKit/chromium/src/WebPagePopupImpl.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebPagePopupImpl.h1
-rw-r--r--Source/WebKit/chromium/src/WebRuntimeFeatures.cpp94
-rw-r--r--Source/WebKit/chromium/src/WebViewBenchmarkSupportImpl.cpp14
-rw-r--r--Source/WebKit/chromium/src/WebViewImpl.cpp56
-rw-r--r--Source/WebKit/chromium/src/WebViewImpl.h13
-rw-r--r--Source/WebKit/chromium/tests/CCDamageTrackerTest.cpp22
-rw-r--r--Source/WebKit/chromium/tests/CCLayerIteratorTest.cpp22
-rw-r--r--Source/WebKit/chromium/tests/CCLayerSorterTest.cpp14
-rw-r--r--Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp652
-rw-r--r--Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp23
-rw-r--r--Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp8
-rw-r--r--Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp12
-rw-r--r--Source/WebKit/chromium/tests/CCQuadCullerTest.cpp6
-rw-r--r--Source/WebKit/chromium/tests/CCRenderSurfaceTest.cpp3
-rw-r--r--Source/WebKit/chromium/tests/CCTiledLayerTestCommon.cpp8
-rw-r--r--Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h6
-rw-r--r--Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp5
-rw-r--r--Source/WebKit/chromium/tests/ContentLayerChromiumTest.cpp4
-rw-r--r--Source/WebKit/chromium/tests/IDBAbortOnCorruptTest.cpp2
-rw-r--r--Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp1
-rw-r--r--Source/WebKit/chromium/tests/IDBFakeBackingStore.h1
-rw-r--r--Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp24
-rw-r--r--Source/WebKit/chromium/tests/MemoryInfo.cpp61
-rw-r--r--Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp150
-rw-r--r--Source/WebKit/chromium/tests/WebViewTest.cpp8
61 files changed, 1319 insertions, 646 deletions
diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog
index ca446fe90..c9b02eb2e 100644
--- a/Source/WebKit/chromium/ChangeLog
+++ b/Source/WebKit/chromium/ChangeLog
@@ -1,3 +1,561 @@
+2012-07-29 Lu Guanqun <guanqun.lu@intel.com>
+
+ [chromium] pass acceleratePainting info to settings
+ https://bugs.webkit.org/show_bug.cgi?id=92467
+
+ Reviewed by Eric Seidel.
+
+ The acceleratePainting info is not passed into settings correctly so
+ that GPU composition would not use the code path of accelerated painting.
+
+ * src/WebLayerTreeView.cpp:
+ (WebKit::WebLayerTreeView::Settings::operator CCLayerTreeSettings):
+
+2012-07-29 Rik Cabanier <cabanier@adobe.com>
+
+ Add ENABLE_CSS_COMPOSITING flag
+ https://bugs.webkit.org/show_bug.cgi?id=92553
+
+ Reviewed by Dirk Schulze.
+
+ Adds compiler flag CSS_COMPOSITING to build systems to enable CSS blending and compositing. See spec https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html
+
+ * features.gypi:
+
+2012-07-28 Peter Kasting <pkasting@google.com>
+
+ Sigh. Just disable all the AutoResize tests after the first three.
+ https://bugs.webkit.org/show_bug.cgi?id=92318
+
+ Unreviewed, making bots happier.
+
+ * tests/WebViewTest.cpp:
+
+2012-07-28 Peter Kasting <pkasting@google.com>
+
+ Try disabling different test in hopes of tracking down the real problem.
+ https://bugs.webkit.org/show_bug.cgi?id=92318
+
+ Unreviewed, making bots happier.
+
+ * tests/WebViewTest.cpp:
+
+2012-07-27 Peter Kasting <pkasting@google.com>
+
+ Disable failing test.
+ https://bugs.webkit.org/show_bug.cgi?id=92318
+
+ Unreviewed, making bots happier.
+
+ * tests/WebViewTest.cpp:
+
+2012-07-27 Scott Graham <scottmg@chromium.org>
+
+ Change navigator.webkitGamepads[] to navigator.webkitGetGamepads()
+ https://bugs.webkit.org/show_bug.cgi?id=92533
+
+ Reviewed by Adam Barth.
+
+ Renames for updated access point.
+
+ * src/WebRuntimeFeatures.cpp:
+ (WebKit::WebRuntimeFeatures::enableGamepad):
+ (WebKit::WebRuntimeFeatures::isGamepadEnabled):
+
+2012-07-27 Kevin Ellis <kevers@chromium.org>
+
+ [chromium] Calendar for input type=date should be larger on devices that support touch input.
+ https://bugs.webkit.org/show_bug.cgi?id=92424
+
+ Reviewed by Kent Tamura.
+
+ Plumbs the deviceSupportsTouch setting through to the popup page so
+ that the Calendar popup can be enlarged on screens that support touch
+ input.
+
+ * src/WebPagePopupImpl.cpp:
+ (WebKit::WebPagePopupImpl::initPage):
+
+2012-07-27 Peter Beverloo <peter@chromium.org>
+
+ Unreviewed. Rolled DEPS.
+
+ * DEPS:
+
+2012-07-27 Oli Lan <olilan@chromium.org>
+
+ [chromium] Fix issues in visiblePositionForWindowPoint (offscreen points / iframes).
+ https://bugs.webkit.org/show_bug.cgi?id=79117
+
+ Fix two issues in WebFrameImpl::visiblePositionForWindowPoint.
+
+ 1) If the point is off-screen, the visiblePosition is clipped to the screen.
+ - The fix is to add HitTestRequest::IgnoreClipping.
+
+ 2) The result is incorrect if the point is within an iframe.
+ - This is because we are calling convertFromContainingWindow twice: once in windowToContents,
+ and then explicitly as well.
+ - This patch removes the explicit call to convertFromContainingWindow.
+
+ Reviewed by Adam Barth.
+
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::visiblePositionForWindowPoint):
+
+2012-07-27 Peter Beverloo <peter@chromium.org>
+
+ Unreviewed. Rolled DEPS.
+
+ * DEPS:
+
+2012-07-27 Alec Flett <alecflett@chromium.org>
+
+ IndexedDB: inject index keys on cursor/objectstore/index get success handlers
+ https://bugs.webkit.org/show_bug.cgi?id=91123
+
+ Reviewed by Tony Chang.
+
+ Remove method no longer used.
+
+ * tests/IDBFakeBackingStore.h:
+
+2012-07-26 Yoshifumi Inoue <yosin@chromium.org>
+
+ [Forms] Introduce runtime feature flags for input type datetime, datetimelocal, month, time, week
+ https://bugs.webkit.org/show_bug.cgi?id=92339
+
+ Reviewed by Kent Tamura.
+
+ To detect compilation errors and test failure earlier, I would like
+ build and run tests for input type datetime, datetime-local, month,
+ time and week with runtime feature flags to avoid behavior changes
+ on chromium browser.
+
+ This patch adds query and change functions for runtime features of
+ input type datetime, datetime-local, month, time and week to WebRuntimeFeatures
+ class for exposing DRT and chromium browser expermental flags.
+
+ * features.gypi: Turn on ENABLE_INPUT_TYPE_DATETIME, ENABLE_INPUT_TYPE_DATETIMELOCAL,
+ ENABLE_INPUT_TYPE_MONTH, ENABLE_INPUT_TYPE_TIME, and ENABLE_INPUT_TYPE_WEEK for all OS.
+ * public/WebRuntimeFeatures.h:
+ (WebRuntimeFeatures):
+ * src/WebRuntimeFeatures.cpp:
+ (WebKit::WebRuntimeFeatures::enableInputTypeDateTime): Added.
+ (WebKit::WebRuntimeFeatures::isInputTypeDateTimeEnabled): Added.
+ (WebKit::WebRuntimeFeatures::enableInputTypeDateTimeLocal): Added.
+ (WebKit::WebRuntimeFeatures::isInputTypeDateTimeLocalEnabled): Added.
+ (WebKit::WebRuntimeFeatures::enableInputTypeMonth): Added.
+ (WebKit::WebRuntimeFeatures::isInputTypeMonthEnabled): Added.
+ (WebKit::WebRuntimeFeatures::enableInputTypeTime): Added.
+ (WebKit::WebRuntimeFeatures::isInputTypeTimeEnabled): Added.
+ (WebKit::WebRuntimeFeatures::enableInputTypeWeek): Added.
+ (WebKit::WebRuntimeFeatures::isInputTypeWeekEnabled): Added.
+
+2012-07-26 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r123799.
+ http://trac.webkit.org/changeset/123799
+ https://bugs.webkit.org/show_bug.cgi?id=92431
+
+ broke the Apple Mac build (Requested by bweinstein on
+ #webkit).
+
+ * src/WebInputEventConversion.cpp:
+ (WebKit):
+ * src/WebInputEventConversion.h:
+ (WebKit):
+ * src/WebPluginContainerImpl.cpp:
+ (WebKit::WebPluginContainerImpl::handleEvent):
+ * src/WebPluginContainerImpl.h:
+ (WebPluginContainerImpl):
+
+2012-07-26 Sadrul Habib Chowdhury <sadrul@chromium.org>
+
+ Propagate gesture events to plugins.
+ https://bugs.webkit.org/show_bug.cgi?id=92281
+
+ Reviewed by Adam Barth.
+
+ Propagate gesture events to plugins.
+
+ * src/WebInputEventConversion.cpp:
+ (WebKit):
+ (WebKit::WebGestureEventBuilder::WebGestureEventBuilder):
+ * src/WebInputEventConversion.h:
+ (WebCore):
+ (WebKit):
+ (WebGestureEventBuilder):
+ * src/WebPluginContainerImpl.cpp:
+ (WebKit::WebPluginContainerImpl::handleEvent):
+ * src/WebPluginContainerImpl.h:
+ (WebCore):
+ (WebPluginContainerImpl):
+
+2012-07-26 Adrienne Walker <enne@google.com>
+
+ [chromium] Remove redundant surface origin transforms
+ https://bugs.webkit.org/show_bug.cgi?id=91815
+
+ Reviewed by Stephen White.
+
+ Clean up use of origin transforms in tests. Where possible, test
+ against the equivalent draw transform.
+
+ * tests/CCLayerTreeHostCommonTest.cpp:
+ * tests/CCLayerTreeHostImplTest.cpp:
+ * tests/CCRenderSurfaceTest.cpp:
+
+2012-07-25 David Grogan <dgrogan@chromium.org>
+
+ IndexedDB: WebKit API interfaces for "upgradeneeded" methods and events
+ https://bugs.webkit.org/show_bug.cgi?id=92203
+
+ Reviewed by Adam Barth.
+
+ This is the beginning of our typical three-sided-patch process.
+
+ * public/WebIDBCallbacks.h:
+ (WebKit::WebIDBCallbacks::onBlocked):
+ (WebKit::WebIDBCallbacks::onUpgradeNeeded):
+ * public/WebIDBDatabaseCallbacks.h:
+ (WebKit::WebIDBDatabaseCallbacks::onVersionChange):
+ * public/WebIDBFactory.h:
+ (WebIDBFactory):
+ (WebKit::WebIDBFactory::open):
+ * src/WebIDBFactoryImpl.cpp:
+ (WebKit::WebIDBFactoryImpl::open):
+ (WebKit):
+ * src/WebIDBFactoryImpl.h:
+ (WebIDBFactoryImpl):
+
+2012-07-19 Adrienne Walker <enne@google.com>
+
+ [chromium] Make all compositor screen space transforms operate on content rects
+ https://bugs.webkit.org/show_bug.cgi?id=91807
+
+ Reviewed by Kenneth Russell.
+
+ Update tests that deal with screen space transforms to reflect this change.
+
+ * tests/CCLayerTreeHostCommonTest.cpp:
+ * tests/TiledLayerChromiumTest.cpp:
+
+2012-07-25 Andrew Wilson <atwilson@chromium.org>
+
+ Unreviewed chromium change to disable failing WebViewTest.AutoResizeInBetweenSizes.
+ https://bugs.webkit.org/show_bug.cgi?id=92318
+
+ * tests/WebViewTest.cpp:
+
+2012-07-25 Scott Graham <scottmg@chromium.org>
+
+ [Chromium] fix double->float warnings in CCLayerTreeHostCommonTest.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=92271
+
+ Reviewed by Adrienne Walker.
+
+ Fix compile warnings on Windows.
+
+ * tests/CCLayerTreeHostCommonTest.cpp:
+
+2012-07-25 Dana Jansens <danakj@chromium.org>
+
+ [chromium] Move WebFilterOperations from RenderPassDrawQuad to RenderPass
+ https://bugs.webkit.org/show_bug.cgi?id=91885
+
+ Reviewed by Adrienne Walker.
+
+ * tests/CCLayerTreeHostImplTest.cpp:
+ * tests/LayerRendererChromiumTest.cpp:
+ (FakeCCRendererClient::FakeCCRendererClient):
+ (FakeCCRendererClient::rootRenderPass):
+ (FakeCCRendererClient::renderPassesInDrawOrder):
+ (FakeCCRendererClient::renderPasses):
+ (FakeCCRendererClient):
+ (TEST_F):
+ (TEST):
+
+2012-07-24 Shawn Singh <shawnsingh@chromium.org>
+
+ [chromium] Refactor CCLayerTreeHostCommon: move root layer special case initialization into internal code.
+ https://bugs.webkit.org/show_bug.cgi?id=88953
+
+ Reviewed by Adrienne Walker.
+
+ Unit tests updated to account for the new less-special root layer setup.
+ - most test cases just needed to remove root->renderSurface()->setContentBounds(), createRenderSurface(), and renderSurfaceLayerList.append().
+ - some test cases originally relied on setting some awkward unconventional bounds of the rootLayer that were different than the rootLayer's renderSurface. these tests are updated.
+ - a few minor cleanups otherwise.
+
+ * tests/CCDamageTrackerTest.cpp:
+ (WebKitTests::executeCalculateDrawTransformsAndVisibility):
+ * tests/CCLayerIteratorTest.cpp:
+ * tests/CCLayerTreeHostCommonTest.cpp:
+ * tests/CCOcclusionTrackerTest.cpp:
+ (WebKitTests::CCOcclusionTrackerTest::calcDrawEtc):
+
+2012-07-25 Taiju Tsuiki <tzik@chromium.org>
+
+ FileSystem should provide a way to delete filesystem.
+ https://bugs.webkit.org/show_bug.cgi?id=91861
+
+ Reviewed by Adam Barth.
+
+ * public/WebFrameClient.h:
+ (WebFrameClient):
+ (WebKit::WebFrameClient::deleteFileSystem):
+ * src/LocalFileSystemChromium.cpp: Add deleteFileSystem
+ (WebCore::deleteFileSystemNotAllowed):
+ (WebCore):
+ (WebCore::LocalFileSystem::deleteFileSystem):
+
+2012-07-25 Alok Priyadarshi <alokp@chromium.org>
+
+ [chromium] WebViewBenchmarkSupport::paint API does not work with recording canvas
+ https://bugs.webkit.org/show_bug.cgi?id=92008
+
+ Reviewed by Darin Fisher.
+
+ Moved the ownership of canvas to WebViewBenchmarkSupport::PaintClient.
+
+ * public/WebViewBenchmarkSupport.h:
+ (PaintClient):
+ (WebKit::WebViewBenchmarkSupport::PaintClient::willPaint):
+ (WebKit::WebViewBenchmarkSupport::PaintClient::didPaint):
+ * src/WebViewBenchmarkSupportImpl.cpp:
+ (WebKit::WebViewBenchmarkSupportImpl::paintLayer):
+ (WebKit::WebViewBenchmarkSupportImpl::softwarePaint):
+
+2012-07-24 Dana Jansens <danakj@chromium.org>
+
+ [chromium] Turn the debug HUD into a layer so that it can be drawn as a WebCompositorQuad
+ https://bugs.webkit.org/show_bug.cgi?id=92182
+
+ Reviewed by Adrienne Walker.
+
+ * tests/LayerRendererChromiumTest.cpp:
+ (TEST):
+
+2012-07-25 Adrienne Walker <enne@google.com>
+
+ [chromium] Unify compositor quadTransform/drawTransform/originTransform
+ https://bugs.webkit.org/show_bug.cgi?id=91417
+
+ Reviewed by Kenneth Russell.
+
+ Clean up tests to refer to the new draw transform semantics.
+
+ * tests/CCDamageTrackerTest.cpp:
+ (WebKitTests::createTestTreeWithOneSurface):
+ (WebKitTests::createTestTreeWithTwoSurfaces):
+ (WebKitTests::TEST_F):
+ * tests/CCLayerSorterTest.cpp:
+ * tests/CCLayerTreeHostCommonTest.cpp:
+ * tests/CCLayerTreeHostImplTest.cpp:
+ * tests/CCLayerTreeHostTest.cpp:
+ (WTF::CCLayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers::commitCompleteOnCCThread):
+ * tests/CCQuadCullerTest.cpp:
+ * tests/TiledLayerChromiumTest.cpp:
+
+2012-07-25 Kevin Ellis <kevers@chromium.org>
+
+ [chromium] Calendar picker popup displays at wrong scale when deviceScaleFactor != 1.
+ https://bugs.webkit.org/show_bug.cgi?id=92177
+
+ Manually tested at deviceScaleFactor = 1 and 2.
+
+ Reviewed by Kent Tamura.
+
+ The device scale factor was not being set for the calendar popup.
+ As a result, the popup was rendered too small on hidpi displays.
+ This patch sets the device scale factor for any page popup.
+
+ * src/WebPagePopupImpl.cpp:
+ (WebKit::WebPagePopupImpl::initPage):
+
+2012-07-25 MORITA Hajime <morrita@google.com>
+
+ Another unreviewed win build fix against r123569.
+
+ * tests/IDBAbortOnCorruptTest.cpp:
+
+2012-07-25 MORITA Hajime <morrita@google.com>
+
+ Unreviewed win build fix against r123569.
+
+ * tests/IDBAbortOnCorruptTest.cpp:
+ * tests/IDBDatabaseBackendTest.cpp:
+
+2012-07-24 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed. Rolled DEPS.
+
+ * DEPS:
+
+2012-07-24 Dave Tu <dtu@chromium.org>
+
+ [chromium] Move renderingStats from WebView to WebWidget.
+ https://bugs.webkit.org/show_bug.cgi?id=92184
+
+ Reviewed by Adam Barth.
+
+ We are going to add some rendering stats that work in non-composited mode, so the renderingStats() method should be moved from WebView to WebWidget.
+
+ * public/WebView.h:
+ (WebKit):
+ (WebView):
+ * public/WebWidget.h:
+ (WebKit):
+ (WebWidget):
+ (WebKit::WebWidget::renderingStats):
+ * src/WebViewImpl.h:
+ (WebViewImpl):
+
+2012-07-24 Alec Flett <alecflett@chromium.org>
+
+ IndexedDB: fix #include dependencies so IDBRequest isn't an include root
+ https://bugs.webkit.org/show_bug.cgi?id=92167
+
+ Reviewed by Tony Chang.
+
+ Remove implicit dependencies due to using IDBRequest.h, and fix all
+ places that break as a result.
+
+ * src/IDBCallbacksProxy.cpp:
+ * src/WebIDBDatabaseImpl.cpp:
+ * src/WebIDBTransactionImpl.cpp:
+
+2012-07-24 Adam Barth <abarth@webkit.org>
+
+ [Chromium] Support scrolling and zooming to focused input elements
+ https://bugs.webkit.org/show_bug.cgi?id=91661
+
+ Reviewed by Darin Fisher.
+
+ This patch introduces saveScrollAndScaleState and
+ restoreScrollAndScaleState, which can be used to save and restore the
+ scroll and scale state of the WebView, respectively. These functions
+ will be used by Chromium on Android to save the scale and scrolls state
+ before zoom into a text field so that we can "undo" the zoom if the
+ user didn't mean to zoom into the text field.
+
+ I wanted to write unit tests for these functions, but it wasn't clear
+ to me how to write the test because startPageScaleAnimation appears to
+ complete asynchronously.
+
+ * public/WebView.h:
+ (WebView):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::WebViewImpl):
+ (WebKit::WebViewImpl::saveScrollAndScaleState):
+ (WebKit):
+ (WebKit::WebViewImpl::restoreScrollAndScaleState):
+ (WebKit::WebViewImpl::resetSavedScrollAndScaleState):
+ (WebKit::WebViewImpl::didCommitLoad):
+ * src/WebViewImpl.h:
+ (WebViewImpl):
+
+2012-07-24 Dave Tu <dtu@chromium.org>
+
+ [chromium] Add time spent painting to GPU benchmarking renderingStats() API.
+ https://bugs.webkit.org/show_bug.cgi?id=90019
+
+ Reviewed by Adrienne Walker.
+
+ * src/WebLayerTreeView.cpp:
+ (WebKit::WebLayerTreeView::renderingStats):
+ * tests/CCLayerTreeHostTest.cpp:
+ * tests/CCTiledLayerTestCommon.cpp:
+ (WebKitTests::FakeLayerTextureUpdater::Texture::prepareRect):
+ (WebKitTests::FakeTiledLayerChromium::update):
+ * tests/CCTiledLayerTestCommon.h:
+ (Texture):
+ (FakeTiledLayerChromium):
+ * tests/Canvas2DLayerBridgeTest.cpp:
+ * tests/ContentLayerChromiumTest.cpp:
+ (WebKit::TEST):
+ * tests/TiledLayerChromiumTest.cpp:
+
+2012-07-24 Jian Li <jianli@chromium.org>
+
+ Add per-context setting for html notifications
+ https://bugs.webkit.org/show_bug.cgi?id=91295
+
+ Reviewed by Adam Barth.
+
+ Add new per-context feature for chromium port.
+
+ * public/WebPermissionClient.h:
+ (WebPermissionClient):
+ (WebKit::WebPermissionClient::allowHTMLNotifications):
+ * src/ContextFeaturesClientImpl.cpp:
+ (WebKit::ContextFeaturesClientImpl::askIfIsEnabled):
+
+2012-07-24 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r123499.
+ http://trac.webkit.org/changeset/123499
+ https://bugs.webkit.org/show_bug.cgi?id=92161
+
+ Android fails to compile (Requested by zhenyao on #webkit).
+
+ * src/AssertMatchingEnums.cpp:
+
+2012-07-24 Terry Anderson <tdanderson@chromium.org>
+
+ [chromium] Add a bounding box member in WebGestureEvent
+ https://bugs.webkit.org/show_bug.cgi?id=92144
+
+ Reviewed by Adam Barth.
+
+ The new |boundingBox| member will be used to store the touch region for a WebGestureEvent.
+ This will be useful for gesture target fuzzing across multiple different gesture types
+ (tap, long press, scroll, etc.)
+
+ * public/WebInputEvent.h:
+ (WebGestureEvent):
+ * src/WebInputEvent.cpp:
+ (SameSizeAsWebGestureEvent):
+
+2012-07-24 Nico Weber <thakis@chromium.org>
+
+ [chromium/mac] Add cursor resource pngs to the pak file.
+ https://bugs.webkit.org/show_bug.cgi?id=92148
+
+ Reviewed by Tony Chang.
+
+ Once https://chromiumcodereview.appspot.com/10817031/ has landed, they can be
+ removed from WebCore.gyp's mac_bundle_resources. Part of http://crbug.com/137588
+
+ * WebKit.grd:
+
+2012-07-24 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r123472.
+ http://trac.webkit.org/changeset/123472
+ https://bugs.webkit.org/show_bug.cgi?id=92134
+
+ Revert roll to v8 version that crashes sporadically (Requested
+ by atwilson on #webkit).
+
+ * DEPS:
+
+2012-07-24 Keishi Hattori <keishi@webkit.org>
+
+ [Chromium] Page popup should close on mouse down
+ https://bugs.webkit.org/show_bug.cgi?id=92092
+
+ Reviewed by Kent Tamura.
+
+ Page popup should close on mouse down because some elements(e.g. <input type=color>) don't have a blur event that
+ we can hook to hide the page popup when the user clicks on the page.
+
+ * src/WebPagePopupImpl.h:
+ (WebKit::WebPagePopupImpl::hasSamePopupClient): Returns true if the given WebPagePopupImpl have the same popup client.
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::handleMouseDown): Close all popups when the page is clicked. Checks if the
+ mouse down event opened the same popup we just closed.
+
2012-07-24 Jochen Eisinger <jochen@chromium.org>
Unreviewed. Rolled DEPS.
diff --git a/Source/WebKit/chromium/DEPS b/Source/WebKit/chromium/DEPS
index 2e48b10e1..2aabb4d59 100644
--- a/Source/WebKit/chromium/DEPS
+++ b/Source/WebKit/chromium/DEPS
@@ -32,7 +32,7 @@
vars = {
'chromium_svn': 'http://src.chromium.org/svn/trunk/src',
- 'chromium_rev': '148093'
+ 'chromium_rev': '148739'
}
deps = {
diff --git a/Source/WebKit/chromium/WebKit.grd b/Source/WebKit/chromium/WebKit.grd
index 4da7600ae..c7c251c21 100644
--- a/Source/WebKit/chromium/WebKit.grd
+++ b/Source/WebKit/chromium/WebKit.grd
@@ -249,6 +249,36 @@
<include name="IDR_AUDIO_SPATIALIZATION_T345_P315" file="..\..\WebCore\platform\audio\resources\IRC_Composite_C_R0195_T345_P315.wav" type="BINDATA"/>
<include name="IDR_AUDIO_SPATIALIZATION_T345_P330" file="..\..\WebCore\platform\audio\resources\IRC_Composite_C_R0195_T345_P330.wav" type="BINDATA"/>
<include name="IDR_AUDIO_SPATIALIZATION_T345_P345" file="..\..\WebCore\platform\audio\resources\IRC_Composite_C_R0195_T345_P345.wav" type="BINDATA"/>
+ <if expr="is_macosx">
+ <include name="IDR_ALIAS_CURSOR" file="../../WebCore/Resources/aliasCursor.png" type="BINDATA" />
+ <include name="IDR_CELL_CURSOR" file="../../WebCore/Resources/cellCursor.png" type="BINDATA" />
+ <include name="IDR_CONTEXTMENU_CURSOR" file="../../WebCore/Resources/contextMenuCursor.png" type="BINDATA" />
+ <include name="IDR_COPY_CURSOR" file="../../WebCore/Resources/copyCursor.png" type="BINDATA" />
+ <include name="IDR_EAST_RESIZE_CURSOR" file="../../WebCore/Resources/eastResizeCursor.png" type="BINDATA" />
+ <include name="IDR_EASTWEST_RESIZE_CURSOR" file="../../WebCore/Resources/eastWestResizeCursor.png" type="BINDATA" />
+ <include name="IDR_HELP_CURSOR" file="../../WebCore/Resources/helpCursor.png" type="BINDATA" />
+ <include name="IDR_LINK_CURSOR" file="../../WebCore/Resources/linkCursor.png" type="BINDATA" />
+ <include name="IDR_MISSING_IMAGE_CURSOR" file="../../WebCore/Resources/missingImage.png" type="BINDATA" />
+ <include name="IDR_MOVE_CURSOR" file="../../WebCore/Resources/moveCursor.png" type="BINDATA" />
+ <include name="IDR_NODROP_CURSOR" file="../../WebCore/Resources/noDropCursor.png" type="BINDATA" />
+ <include name="IDR_NONE_CURSOR" file="../../WebCore/Resources/noneCursor.png" type="BINDATA" />
+ <include name="IDR_NORTHEAST_RESIZE_CURSOR" file="../../WebCore/Resources/northEastResizeCursor.png" type="BINDATA" />
+ <include name="IDR_NORTHEASTSOUTHWEST_RESIZE_CURSOR" file="../../WebCore/Resources/northEastSouthWestResizeCursor.png" type="BINDATA" />
+ <include name="IDR_NORTH_RESIZE_CURSOR" file="../../WebCore/Resources/northResizeCursor.png" type="BINDATA" />
+ <include name="IDR_NORTHSOUTH_RESIZE_CURSOR" file="../../WebCore/Resources/northSouthResizeCursor.png" type="BINDATA" />
+ <include name="IDR_NORTHWEST_RESIZE_CURSOR" file="../../WebCore/Resources/northWestResizeCursor.png" type="BINDATA" />
+ <include name="IDR_NORTHWESTSOUTHEAST_RESIZE_CURSOR" file="../../WebCore/Resources/northWestSouthEastResizeCursor.png" type="BINDATA" />
+ <include name="IDR_PROGRESS_CURSOR" file="../../WebCore/Resources/progressCursor.png" type="BINDATA" />
+ <include name="IDR_SOUTHEAST_RESIZE_CURSOR" file="../../WebCore/Resources/southEastResizeCursor.png" type="BINDATA" />
+ <include name="IDR_SOUTH_RESIZE_CURSOR" file="../../WebCore/Resources/southResizeCursor.png" type="BINDATA" />
+ <include name="IDR_SOUTHWEST_RESIZE_CURSOR" file="../../WebCore/Resources/southWestResizeCursor.png" type="BINDATA" />
+ <include name="IDR_VERTICALTEXT_CURSOR" file="../../WebCore/Resources/verticalTextCursor.png" type="BINDATA" />
+ <include name="IDR_WAIT_CURSOR" file="../../WebCore/Resources/waitCursor.png" type="BINDATA" />
+ <include name="IDR_WEST_RESIZE_CURSOR" file="../../WebCore/Resources/westResizeCursor.png" type="BINDATA" />
+ <include name="IDR_ZOOMIN_CURSOR" file="../../WebCore/Resources/zoomInCursor.png" type="BINDATA" />
+ <include name="IDR_ZOOMOUT_CURSOR" file="../../WebCore/Resources/zoomOutCursor.png" type="BINDATA" />
+ </if>
+
</includes>
</release>
</grit>
diff --git a/Source/WebKit/chromium/WebKit.gypi b/Source/WebKit/chromium/WebKit.gypi
index 831241de4..b507189db 100644
--- a/Source/WebKit/chromium/WebKit.gypi
+++ b/Source/WebKit/chromium/WebKit.gypi
@@ -125,6 +125,7 @@
'tests/ListenerLeakTest.cpp',
'tests/LocalizedDateICUTest.cpp',
'tests/LocalizedNumberICUTest.cpp',
+ 'tests/MemoryInfo.cpp',
'tests/MockCCQuadCuller.h',
'tests/OpaqueRectTrackingContentLayerDelegateTest.cpp',
'tests/OpenTypeVerticalDataTest.cpp',
diff --git a/Source/WebKit/chromium/features.gypi b/Source/WebKit/chromium/features.gypi
index 3432342a9..6aa57be3d 100644
--- a/Source/WebKit/chromium/features.gypi
+++ b/Source/WebKit/chromium/features.gypi
@@ -42,6 +42,7 @@
'ENABLE_CSS_BOX_DECORATION_BREAK=1',
'ENABLE_CSS_EXCLUSIONS=1',
'ENABLE_CSS_FILTERS=1',
+ 'ENABLE_CSS_COMPOSITING=0',
'ENABLE_CSS_IMAGE_SET=1',
'ENABLE_CSS_IMAGE_RESOLUTION=0',
'ENABLE_CSS_REGIONS=1',
@@ -68,6 +69,11 @@
'ENABLE_IFRAME_SEAMLESS=1',
'ENABLE_INDEXED_DATABASE=1',
'ENABLE_INPUT_TYPE_DATE=1',
+ 'ENABLE_INPUT_TYPE_DATETIME=1',
+ 'ENABLE_INPUT_TYPE_DATETIMELOCAL=1',
+ 'ENABLE_INPUT_TYPE_MONTH=1',
+ 'ENABLE_INPUT_TYPE_TIME=1',
+ 'ENABLE_INPUT_TYPE_WEEK=1',
'ENABLE_JAVASCRIPT_DEBUGGER=1',
'ENABLE_LEGACY_CSS_VENDOR_PREFIXES=0',
'ENABLE_LEGACY_VIEWPORT_ADAPTION=1',
@@ -143,11 +149,6 @@
'ENABLE_CALENDAR_PICKER=0',
'ENABLE_INPUT_SPEECH=0',
'ENABLE_INPUT_TYPE_COLOR=0',
- 'ENABLE_INPUT_TYPE_DATETIME=1',
- 'ENABLE_INPUT_TYPE_DATETIMELOCAL=1',
- 'ENABLE_INPUT_TYPE_MONTH=1',
- 'ENABLE_INPUT_TYPE_TIME=1',
- 'ENABLE_INPUT_TYPE_WEEK=1',
'ENABLE_JAVASCRIPT_I18N_API=0',
'ENABLE_LEGACY_NOTIFICATIONS=0',
'ENABLE_MEDIA_CAPTURE=1',
diff --git a/Source/WebKit/chromium/public/WebFrameClient.h b/Source/WebKit/chromium/public/WebFrameClient.h
index 62b5f0de8..bc32d6d84 100644
--- a/Source/WebKit/chromium/public/WebFrameClient.h
+++ b/Source/WebKit/chromium/public/WebFrameClient.h
@@ -346,6 +346,15 @@ public:
WebFrame*, WebFileSystem::Type, long long size,
bool create, WebFileSystemCallbacks*) { }
+ // Deletes FileSystem.
+ // WebFileSystemCallbacks::didSucceed() must be called when the operation
+ // is completed successfully. WebFileSystemCallbacks::didFail() must be
+ // called otherwise.
+ // All in-flight operations and following operations may fail after the
+ // FileSystem is deleted.
+ virtual void deleteFileSystem(
+ WebFrame*, WebFileSystem::Type, WebFileSystemCallbacks*) { }
+
// Quota ---------------------------------------------------------
// Queries the origin's storage usage and quota information.
diff --git a/Source/WebKit/chromium/public/WebIDBCallbacks.h b/Source/WebKit/chromium/public/WebIDBCallbacks.h
index a63c0bc9e..ce100f295 100644
--- a/Source/WebKit/chromium/public/WebIDBCallbacks.h
+++ b/Source/WebKit/chromium/public/WebIDBCallbacks.h
@@ -58,7 +58,9 @@ public:
virtual void onSuccess(const WebSerializedScriptValue&, const WebIDBKey&, const WebIDBKeyPath&) { WEBKIT_ASSERT_NOT_REACHED(); }
virtual void onSuccessWithContinuation() { WEBKIT_ASSERT_NOT_REACHED(); }
virtual void onBlocked() { WEBKIT_ASSERT_NOT_REACHED(); }
+ virtual void onBlocked(long long oldVersion) { WEBKIT_ASSERT_NOT_REACHED(); }
virtual void onSuccessWithPrefetch(const WebVector<WebIDBKey>& keys, const WebVector<WebIDBKey>& primaryKeys, const WebVector<WebSerializedScriptValue>& values) { WEBKIT_ASSERT_NOT_REACHED(); }
+ virtual void onUpgradeNeeded(long long oldVersion, WebIDBTransaction*, WebIDBDatabase*) { WEBKIT_ASSERT_NOT_REACHED(); }
};
} // namespace WebKit
diff --git a/Source/WebKit/chromium/public/WebIDBDatabaseCallbacks.h b/Source/WebKit/chromium/public/WebIDBDatabaseCallbacks.h
index 838a71ff9..0907b8bf0 100644
--- a/Source/WebKit/chromium/public/WebIDBDatabaseCallbacks.h
+++ b/Source/WebKit/chromium/public/WebIDBDatabaseCallbacks.h
@@ -35,6 +35,7 @@ class WebIDBDatabaseCallbacks {
public:
virtual ~WebIDBDatabaseCallbacks() { }
+ virtual void onVersionChange(long long oldVersion, long long newVersion) { WEBKIT_ASSERT_NOT_REACHED(); }
virtual void onVersionChange(const WebString& requestedVersion) { WEBKIT_ASSERT_NOT_REACHED(); }
};
diff --git a/Source/WebKit/chromium/public/WebIDBFactory.h b/Source/WebKit/chromium/public/WebIDBFactory.h
index e956ebded..f10a8eb9a 100644
--- a/Source/WebKit/chromium/public/WebIDBFactory.h
+++ b/Source/WebKit/chromium/public/WebIDBFactory.h
@@ -31,6 +31,7 @@
#include "WebDOMStringList.h"
#include "WebIDBCallbacks.h"
+#include "WebIDBMetadata.h"
#include "WebSecurityOrigin.h"
#include "platform/WebCommon.h"
#include "platform/WebString.h"
@@ -53,8 +54,15 @@ public:
virtual void getDatabaseNames(WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* frame, const WebString& dataDir) { WEBKIT_ASSERT_NOT_REACHED(); }
+ // FIXME: Delete this method when derived classes in chromium have
+ // implemented the other open method.
+ virtual void open(const WebString& name, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* frame, const WebString& dataDir)
+ {
+ open(name, WebIDBMetadata::NoIntVersion, callbacks, origin, frame, dataDir);
+ }
+
// The WebKit implementation of open ignores the WebFrame* parameter.
- virtual void open(const WebString& name, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* frame, const WebString& dataDir) { WEBKIT_ASSERT_NOT_REACHED(); }
+ virtual void open(const WebString& name, long long version, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* frame, const WebString& dataDir) { WEBKIT_ASSERT_NOT_REACHED(); }
virtual void deleteDatabase(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir) { WEBKIT_ASSERT_NOT_REACHED(); }
};
diff --git a/Source/WebKit/chromium/public/WebInputEvent.h b/Source/WebKit/chromium/public/WebInputEvent.h
index b7a5ecbd2..40a6fdb3e 100644
--- a/Source/WebKit/chromium/public/WebInputEvent.h
+++ b/Source/WebKit/chromium/public/WebInputEvent.h
@@ -33,6 +33,7 @@
#include "WebTouchPoint.h"
#include "platform/WebCommon.h"
+#include "platform/WebRect.h"
#include <string.h>
@@ -372,6 +373,7 @@ public:
// NOTE: |deltaX| and |deltaY| represents the amount to scroll for Scroll gesture events. For Pinch gesture events, |deltaX| represents the scaling/magnification factor. For a GestureTap event, |deltaX| and |deltaY| represent the horizontal and vertical radii of the touch region.
float deltaX;
float deltaY;
+ WebRect boundingBox;
WebGestureEvent(unsigned sizeParam = sizeof(WebGestureEvent))
: WebInputEvent(sizeParam)
diff --git a/Source/WebKit/chromium/public/WebPermissionClient.h b/Source/WebKit/chromium/public/WebPermissionClient.h
index 014c2c3f4..5adcde2e0 100644
--- a/Source/WebKit/chromium/public/WebPermissionClient.h
+++ b/Source/WebKit/chromium/public/WebPermissionClient.h
@@ -93,6 +93,9 @@ public:
// Controls whether enabling Web Components API for this frame.
virtual bool allowWebComponents(const WebDocument&, bool defaultValue) { return defaultValue; }
+ // Controls whether enabling HTML notifications for this frame.
+ virtual bool allowHTMLNotifications(const WebDocument&) { return true; }
+
// Notifies the client that the frame would have instantiated a plug-in if plug-ins were enabled.
virtual void didNotAllowPlugins(WebFrame*) { }
diff --git a/Source/WebKit/chromium/public/WebRuntimeFeatures.h b/Source/WebKit/chromium/public/WebRuntimeFeatures.h
index a0dd04997..c3d61d85a 100644
--- a/Source/WebKit/chromium/public/WebRuntimeFeatures.h
+++ b/Source/WebKit/chromium/public/WebRuntimeFeatures.h
@@ -139,6 +139,21 @@ public:
WEBKIT_EXPORT static void enableInputTypeDate(bool);
WEBKIT_EXPORT static bool isInputTypeDateEnabled();
+ WEBKIT_EXPORT static void enableInputTypeDateTime(bool);
+ WEBKIT_EXPORT static bool isInputTypeDateTimeEnabled();
+
+ WEBKIT_EXPORT static void enableInputTypeDateTimeLocal(bool);
+ WEBKIT_EXPORT static bool isInputTypeDateTimeLocalEnabled();
+
+ WEBKIT_EXPORT static void enableInputTypeMonth(bool);
+ WEBKIT_EXPORT static bool isInputTypeMonthEnabled();
+
+ WEBKIT_EXPORT static void enableInputTypeTime(bool);
+ WEBKIT_EXPORT static bool isInputTypeTimeEnabled();
+
+ WEBKIT_EXPORT static void enableInputTypeWeek(bool);
+ WEBKIT_EXPORT static bool isInputTypeWeekEnabled();
+
WEBKIT_EXPORT static void enableDialogElement(bool);
WEBKIT_EXPORT static bool isDialogElementEnabled();
diff --git a/Source/WebKit/chromium/public/WebView.h b/Source/WebKit/chromium/public/WebView.h
index 0085ba51a..4da3363dd 100644
--- a/Source/WebKit/chromium/public/WebView.h
+++ b/Source/WebKit/chromium/public/WebView.h
@@ -63,7 +63,6 @@ struct WebActiveWheelFlingParameters;
struct WebMediaPlayerAction;
struct WebPluginAction;
struct WebPoint;
-struct WebRenderingStats;
class WebView : public WebWidget {
public:
@@ -254,6 +253,14 @@ public:
virtual float minimumPageScaleFactor() const = 0;
virtual float maximumPageScaleFactor() const = 0;
+ // Save the WebView's current scroll and scale state. Each call to this function
+ // overwrites the previously saved scroll and scale state.
+ virtual void saveScrollAndScaleState() = 0;
+
+ // Restore the previously saved scroll and scale state. After restroing the
+ // state, this function deletes any saved scroll and scale state.
+ virtual void restoreScrollAndScaleState() = 0;
+
// Prevent the web page from setting a maximum scale via the viewport meta
// tag. This is an accessibility feature that lets folks zoom in to web
// pages even if the web page tries to block scaling.
@@ -454,10 +461,6 @@ public:
virtual bool isSelectionEditable() const = 0;
- // Fills in a WebRenderingStats struct containing information about the state of the compositor.
- // This call is relatively expensive in threaded mode as it blocks on the compositor thread.
- virtual void renderingStats(WebRenderingStats&) const { }
-
// Benchmarking support --------------------------------------------
virtual WebViewBenchmarkSupport* benchmarkSupport() { return 0; }
diff --git a/Source/WebKit/chromium/public/WebViewBenchmarkSupport.h b/Source/WebKit/chromium/public/WebViewBenchmarkSupport.h
index c8ace3622..c395e37b0 100644
--- a/Source/WebKit/chromium/public/WebViewBenchmarkSupport.h
+++ b/Source/WebKit/chromium/public/WebViewBenchmarkSupport.h
@@ -51,14 +51,15 @@ public:
// when painting is about to occur and when painting is complete.
class PaintClient {
public:
- virtual WebCanvas* createCanvas(const WebSize&) = 0;
-
- // Called by the WebViewBenchmarkSupport when painting is about to
- // occur.
- virtual void willPaint(const WebCanvas&) { }
+ // Called by the WebViewBenchmarkSupport when painting is about to occur.
+ // PaintClient is expected to return an appropriately-sized canvas
+ // for the WebViewBenchmarkSupport to paint on.
+ virtual WebCanvas* willPaint(const WebSize&) { return 0; }
// Called by the WebViewBenchmarkSupport when painting is complete.
- virtual void didPaint(const WebCanvas&) { }
+ // The canvas will not be used after this call and can be destroyed
+ // if necessary.
+ virtual void didPaint(WebCanvas*) { }
protected:
virtual ~PaintClient() { }
};
diff --git a/Source/WebKit/chromium/public/WebWidget.h b/Source/WebKit/chromium/public/WebWidget.h
index 600c523f8..b2a57d66e 100644
--- a/Source/WebKit/chromium/public/WebWidget.h
+++ b/Source/WebKit/chromium/public/WebWidget.h
@@ -48,6 +48,7 @@ class WebInputEvent;
class WebMouseEvent;
class WebString;
struct WebPoint;
+struct WebRenderingStats;
template <typename T> class WebVector;
class WebWidget {
@@ -221,6 +222,10 @@ public:
// following the call to instrumentBeginFrame().
virtual void instrumentCancelFrame() { }
+ // Fills in a WebRenderingStats struct containing information about the state of the compositor.
+ // This call is relatively expensive in threaded mode as it blocks on the compositor thread.
+ virtual void renderingStats(WebRenderingStats&) const { }
+
// The page background color. Can be used for filling in areas without
// content.
virtual WebColor backgroundColor() const { return 0xFFFFFFFF; /* SK_ColorWHITE */ }
diff --git a/Source/WebKit/chromium/scripts/generate_devtools_extension_api.py b/Source/WebKit/chromium/scripts/generate_devtools_extension_api.py
index fbb878df2..d6d9826cb 100644
--- a/Source/WebKit/chromium/scripts/generate_devtools_extension_api.py
+++ b/Source/WebKit/chromium/scripts/generate_devtools_extension_api.py
@@ -41,7 +41,7 @@ def write_devtools_extension_api(output, input_names):
output.write("""
var tabId;
var extensionInfo = {};
- platformExtensionAPI(injectedExtensionAPI("remote-" + top.frames.length));
+ platformExtensionAPI(injectedExtensionAPI("remote-" + window.parent.frames.length));
})();""")
diff --git a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp
index 789d1b623..5f250351a 100644
--- a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp
+++ b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp
@@ -537,6 +537,9 @@ COMPILE_ASSERT_MATCHING_ENUM(WebPageVisibilityStatePreview, PageVisibilityStateP
#if ENABLE(MEDIA_STREAM)
COMPILE_ASSERT_MATCHING_ENUM(WebMediaStreamSource::TypeAudio, MediaStreamSource::TypeAudio);
COMPILE_ASSERT_MATCHING_ENUM(WebMediaStreamSource::TypeVideo, MediaStreamSource::TypeVideo);
+COMPILE_ASSERT_MATCHING_ENUM(WebMediaStreamSource::ReadyStateLive, MediaStreamSource::ReadyStateLive);
+COMPILE_ASSERT_MATCHING_ENUM(WebMediaStreamSource::ReadyStateMuted, MediaStreamSource::ReadyStateMuted);
+COMPILE_ASSERT_MATCHING_ENUM(WebMediaStreamSource::ReadyStateEnded, MediaStreamSource::ReadyStateEnded);
COMPILE_ASSERT_MATCHING_ENUM(WebICEOptions::CandidateTypeAll, IceOptions::ALL);
COMPILE_ASSERT_MATCHING_ENUM(WebICEOptions::CandidateTypeNoRelay, IceOptions::NO_RELAY);
diff --git a/Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp b/Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp
index 63e16726e..bc4cfb834 100644
--- a/Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp
+++ b/Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp
@@ -143,6 +143,8 @@ bool ContextFeaturesClientImpl::askIfIsEnabled(Document* document, ContextFeatur
case ContextFeatures::ShadowDOM:
case ContextFeatures::StyleScoped:
return m_client->allowWebComponents(WebDocument(document), defaultValue);
+ case ContextFeatures::HTMLNotifications:
+ return m_client->allowHTMLNotifications(WebDocument(document));
default:
return defaultValue;
}
diff --git a/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp b/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp
index a544189b6..7df84d2ff 100644
--- a/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp
+++ b/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp
@@ -31,8 +31,12 @@
#if ENABLE(INDEXED_DATABASE)
+#include "IDBCursorBackendInterface.h"
+#include "IDBDatabaseBackendInterface.h"
#include "IDBDatabaseBackendProxy.h"
#include "IDBDatabaseError.h"
+#include "IDBObjectStoreBackendInterface.h"
+#include "IDBTransactionBackendInterface.h"
#include "WebIDBCallbacks.h"
#include "WebIDBCursorImpl.h"
#include "WebIDBDatabaseImpl.h"
diff --git a/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp b/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp
index ca390ba90..277a665cf 100644
--- a/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp
+++ b/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp
@@ -69,11 +69,6 @@ PassRefPtr<SerializedScriptValue> IDBCursorBackendProxy::value() const
return m_idbCursor->value();
}
-void IDBCursorBackendProxy::update(PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBCallbacks> callbacks, ExceptionCode& ec)
-{
- m_idbCursor->update(value, new WebIDBCallbacksImpl(callbacks), ec);
-}
-
void IDBCursorBackendProxy::advance(unsigned long count, PassRefPtr<IDBCallbacks> callbacks, ExceptionCode& ec)
{
m_idbCursor->advance(count, new WebIDBCallbacksImpl(callbacks), ec);
diff --git a/Source/WebKit/chromium/src/IDBCursorBackendProxy.h b/Source/WebKit/chromium/src/IDBCursorBackendProxy.h
index 9e4b57008..d742f68e5 100644
--- a/Source/WebKit/chromium/src/IDBCursorBackendProxy.h
+++ b/Source/WebKit/chromium/src/IDBCursorBackendProxy.h
@@ -45,7 +45,6 @@ public:
virtual PassRefPtr<WebCore::IDBKey> key() const;
virtual PassRefPtr<WebCore::IDBKey> primaryKey() const;
virtual PassRefPtr<WebCore::SerializedScriptValue> value() const;
- virtual void update(PassRefPtr<WebCore::SerializedScriptValue>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::ExceptionCode&);
virtual void advance(unsigned long, PassRefPtr<WebCore::IDBCallbacks>, WebCore::ExceptionCode&);
virtual void continueFunction(PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::ExceptionCode&);
virtual void deleteFunction(PassRefPtr<WebCore::IDBCallbacks>, WebCore::ExceptionCode&);
diff --git a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp
index 826407330..4d1c91d07 100755
--- a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp
+++ b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp
@@ -67,14 +67,6 @@ void IDBObjectStoreBackendProxy::get(PassRefPtr<IDBKeyRange> keyRange, PassRefPt
m_webIDBObjectStore->get(keyRange, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec);
}
-void IDBObjectStoreBackendProxy::put(PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
-{
- // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer,
- // all implementations of IDB interfaces are proxy objects.
- IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction);
- m_webIDBObjectStore->put(value, key, static_cast<WebIDBObjectStore::PutMode>(putMode), new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec);
-}
-
void IDBObjectStoreBackendProxy::putWithIndexKeys(PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, const Vector<String>& indexNames, const Vector<IndexKeys>& indexKeys, ExceptionCode& ec)
{
// The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer,
diff --git a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h
index c64028cff..0235077fa 100644
--- a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h
+++ b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h
@@ -44,7 +44,6 @@ public:
virtual ~IDBObjectStoreBackendProxy();
virtual void get(PassRefPtr<WebCore::IDBKeyRange>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
- virtual void put(PassRefPtr<WebCore::SerializedScriptValue>, PassRefPtr<WebCore::IDBKey>, PutMode, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
virtual void putWithIndexKeys(PassRefPtr<WebCore::SerializedScriptValue>, PassRefPtr<WebCore::IDBKey>, PutMode, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, const WTF::Vector<WTF::String>&, const WTF::Vector<IndexKeys>&, WebCore::ExceptionCode&);
virtual void deleteFunction(PassRefPtr<WebCore::IDBKeyRange>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
virtual void clear(PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
diff --git a/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp b/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp
index 6fded29ff..d22412ac8 100644
--- a/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp
+++ b/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp
@@ -183,6 +183,11 @@ static void openFileSystemNotAllowed(ScriptExecutionContext*, PassOwnPtr<AsyncFi
callbacks->didFail(WebKit::WebFileErrorAbort);
}
+static void deleteFileSystemNotAllowed(ScriptExecutionContext*, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+{
+ callbacks->didFail(WebKit::WebFileErrorAbort);
+}
+
static void openFileSystemHelper(ScriptExecutionContext* context, FileSystemType type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, FileSystemSynchronousType synchronousType, long long size, CreationFlag create)
{
bool allowed = true;
@@ -226,6 +231,22 @@ void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, FileSys
openFileSystemHelper(context, type, callbacks, synchronousType, size, CreateIfNotPresent);
}
+void LocalFileSystem::deleteFileSystem(ScriptExecutionContext* context, FileSystemType type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
+{
+ ASSERT(context);
+ ASSERT(context->isDocument());
+
+ Document* document = static_cast<Document*>(context);
+ WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame());
+ WebKit::WebViewImpl* webView = webFrame->viewImpl();
+ if (webView->permissionClient() && !webView->permissionClient()->allowFileSystem(webFrame)) {
+ context->postTask(createCallbackTask(&deleteFileSystemNotAllowed, callbacks));
+ return;
+ }
+
+ webFrame->client()->deleteFileSystem(webFrame, static_cast<WebFileSystem::Type>(type), new WebFileSystemCallbacksImpl(callbacks));
+}
+
} // namespace WebCore
#endif // ENABLE(FILE_SYSTEM)
diff --git a/Source/WebKit/chromium/src/WebFrameImpl.cpp b/Source/WebKit/chromium/src/WebFrameImpl.cpp
index 0cfbac209..f821562f6 100644
--- a/Source/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/Source/WebKit/chromium/src/WebFrameImpl.cpp
@@ -1465,10 +1465,10 @@ VisiblePosition WebFrameImpl::visiblePositionForWindowPoint(const WebPoint& poin
HitTestRequest::HitTestRequestType hitType = HitTestRequest::Move;
hitType |= HitTestRequest::ReadOnly;
hitType |= HitTestRequest::Active;
+ hitType |= HitTestRequest::IgnoreClipping;
HitTestRequest request(hitType);
FrameView* view = frame()->view();
- HitTestResult result(view->windowToContents(
- view->convertFromContainingWindow(IntPoint(point.x, point.y))));
+ HitTestResult result(view->windowToContents(IntPoint(point.x, point.y)));
frame()->document()->renderView()->layer()->hitTest(request, result);
diff --git a/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp b/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp
index e9c0e04af..0d65a87be 100644
--- a/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp
+++ b/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp
@@ -62,11 +62,6 @@ WebSerializedScriptValue WebIDBCursorImpl::value() const
return m_idbCursorBackend->value();
}
-void WebIDBCursorImpl::update(const WebSerializedScriptValue& value, WebIDBCallbacks* callbacks, WebExceptionCode& ec)
-{
- m_idbCursorBackend->update(value, IDBCallbacksProxy::create(adoptPtr(callbacks)), ec);
-}
-
void WebIDBCursorImpl::advance(unsigned long count, WebIDBCallbacks* callbacks, WebExceptionCode& ec)
{
m_idbCursorBackend->advance(count, IDBCallbacksProxy::create(adoptPtr(callbacks)), ec);
diff --git a/Source/WebKit/chromium/src/WebIDBCursorImpl.h b/Source/WebKit/chromium/src/WebIDBCursorImpl.h
index f0d387b62..45a229b38 100644
--- a/Source/WebKit/chromium/src/WebIDBCursorImpl.h
+++ b/Source/WebKit/chromium/src/WebIDBCursorImpl.h
@@ -47,7 +47,6 @@ public:
virtual WebIDBKey key() const;
virtual WebIDBKey primaryKey() const;
virtual WebSerializedScriptValue value() const;
- virtual void update(const WebSerializedScriptValue&, WebIDBCallbacks*, WebExceptionCode&);
virtual void advance(unsigned long, WebIDBCallbacks*, WebExceptionCode&);
virtual void continueFunction(const WebIDBKey&, WebIDBCallbacks*, WebExceptionCode&);
virtual void deleteFunction(WebIDBCallbacks*, WebExceptionCode&);
diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp
index 18573cacf..bc6d09fa1 100644
--- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp
+++ b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp
@@ -33,6 +33,7 @@
#include "IDBDatabaseBackendInterface.h"
#include "IDBDatabaseCallbacksProxy.h"
#include "IDBMetadata.h"
+#include "IDBObjectStoreBackendInterface.h"
#include "IDBTransactionBackendInterface.h"
#include "WebIDBCallbacks.h"
#include "WebIDBDatabaseCallbacks.h"
diff --git a/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp b/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp
index d875e11bc..d14ac71e1 100755
--- a/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp
+++ b/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp
@@ -69,6 +69,13 @@ void WebIDBFactoryImpl::open(const WebString& name, WebIDBCallbacks* callbacks,
m_idbFactoryBackend->open(name, IDBCallbacksProxy::create(adoptPtr(callbacks)).get(), origin, 0, dataDir);
}
+void WebIDBFactoryImpl::open(const WebString& name, long long version, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*, const WebString& dataDir)
+{
+ // FIXME: Pass version along when WebCore::IDBFactoryBackendInterface
+ // has an open method that accepts it.
+ m_idbFactoryBackend->open(name, IDBCallbacksProxy::create(adoptPtr(callbacks)).get(), origin, 0, dataDir);
+}
+
void WebIDBFactoryImpl::deleteDatabase(const WebString& name, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*, const WebString& dataDir)
{
m_idbFactoryBackend->deleteDatabase(name, IDBCallbacksProxy::create(adoptPtr(callbacks)), origin, 0, dataDir);
diff --git a/Source/WebKit/chromium/src/WebIDBFactoryImpl.h b/Source/WebKit/chromium/src/WebIDBFactoryImpl.h
index b3e474df9..fa438d764 100644
--- a/Source/WebKit/chromium/src/WebIDBFactoryImpl.h
+++ b/Source/WebKit/chromium/src/WebIDBFactoryImpl.h
@@ -46,6 +46,7 @@ public:
virtual void getDatabaseNames(WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir);
virtual void open(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir);
+ virtual void open(const WebString& name, long long version, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir);
virtual void deleteDatabase(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir);
private:
diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
index 53d140f42..22a066807 100755
--- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
+++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
@@ -58,11 +58,6 @@ void WebIDBObjectStoreImpl::get(const WebIDBKeyRange& keyRange, WebIDBCallbacks*
m_objectStore->get(keyRange, IDBCallbacksProxy::create(adoptPtr(callbacks)), transaction.getIDBTransactionBackendInterface(), ec);
}
-void WebIDBObjectStoreImpl::put(const WebSerializedScriptValue& value, const WebIDBKey& key, PutMode putMode, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, WebExceptionCode& ec)
-{
- m_objectStore->put(value, key, static_cast<IDBObjectStoreBackendInterface::PutMode>(putMode), IDBCallbacksProxy::create(adoptPtr(callbacks)), transaction.getIDBTransactionBackendInterface(), ec);
-}
-
void WebIDBObjectStoreImpl::putWithIndexKeys(const WebSerializedScriptValue& value, const WebIDBKey& key, PutMode putMode, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, const WebVector<WebString>& webIndexNames, const WebVector<WebIndexKeys>& webIndexKeys, WebExceptionCode& ec)
{
ASSERT(webIndexNames.size() == webIndexKeys.size());
diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h
index e6dc88f54..934cffa99 100644
--- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h
+++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h
@@ -46,7 +46,6 @@ public:
~WebIDBObjectStoreImpl();
void get(const WebIDBKeyRange&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
- void put(const WebSerializedScriptValue&, const WebIDBKey&, PutMode, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
void putWithIndexKeys(const WebSerializedScriptValue&, const WebIDBKey&, PutMode, WebIDBCallbacks*, const WebIDBTransaction&, const WebVector<WebString>& indexNames, const WebVector<WebIndexKeys>&, WebExceptionCode&);
void deleteFunction(const WebIDBKeyRange&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
void clear(WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
diff --git a/Source/WebKit/chromium/src/WebIDBTransactionImpl.cpp b/Source/WebKit/chromium/src/WebIDBTransactionImpl.cpp
index 94610eba9..5cbbee663 100644
--- a/Source/WebKit/chromium/src/WebIDBTransactionImpl.cpp
+++ b/Source/WebKit/chromium/src/WebIDBTransactionImpl.cpp
@@ -28,6 +28,7 @@
#if ENABLE(INDEXED_DATABASE)
+#include "IDBObjectStoreBackendInterface.h"
#include "IDBTransaction.h"
#include "IDBTransactionCallbacksProxy.h"
#include "WebIDBObjectStoreImpl.h"
diff --git a/Source/WebKit/chromium/src/WebInputEvent.cpp b/Source/WebKit/chromium/src/WebInputEvent.cpp
index c0690f8d7..66a0480b4 100644
--- a/Source/WebKit/chromium/src/WebInputEvent.cpp
+++ b/Source/WebKit/chromium/src/WebInputEvent.cpp
@@ -60,7 +60,7 @@ struct SameSizeAsWebMouseWheelEvent : public SameSizeAsWebMouseEvent {
};
struct SameSizeAsWebGestureEvent : public SameSizeAsWebInputEvent {
- int gestureData[6];
+ int gestureData[10];
};
struct SameSizeAsWebTouchEvent : public SameSizeAsWebInputEvent {
diff --git a/Source/WebKit/chromium/src/WebLayerTreeView.cpp b/Source/WebKit/chromium/src/WebLayerTreeView.cpp
index 34eb952fd..b87df0f1b 100644
--- a/Source/WebKit/chromium/src/WebLayerTreeView.cpp
+++ b/Source/WebKit/chromium/src/WebLayerTreeView.cpp
@@ -52,6 +52,7 @@ WebLayerTreeView::Settings::operator CCLayerTreeSettings() const
settings.refreshRate = refreshRate;
settings.defaultTileSize = defaultTileSize;
settings.maxUntiledLayerSize = maxUntiledLayerSize;
+ settings.acceleratePainting = acceleratePainting;
// FIXME: showFPSCounter / showPlatformLayerTree / maxPartialTextureUpdates aren't supported currently.
return settings;
@@ -183,6 +184,8 @@ void WebLayerTreeView::renderingStats(WebRenderingStats& stats) const
stats.numAnimationFrames = ccStats.numAnimationFrames;
stats.numFramesSentToScreen = ccStats.numFramesSentToScreen;
stats.droppedFrameCount = ccStats.droppedFrameCount;
+ stats.totalPaintTimeInSeconds = ccStats.totalPaintTimeInSeconds;
+ stats.totalRasterizeTimeInSeconds = ccStats.totalRasterizeTimeInSeconds;
}
void WebLayerTreeView::loseCompositorContext(int numTimes)
diff --git a/Source/WebKit/chromium/src/WebPagePopupImpl.cpp b/Source/WebKit/chromium/src/WebPagePopupImpl.cpp
index 6d59cc19c..fd5d2f2ad 100644
--- a/Source/WebKit/chromium/src/WebPagePopupImpl.cpp
+++ b/Source/WebKit/chromium/src/WebPagePopupImpl.cpp
@@ -190,6 +190,8 @@ bool WebPagePopupImpl::initPage()
m_page = adoptPtr(new Page(pageClients));
m_page->settings()->setScriptEnabled(true);
m_page->settings()->setAllowScriptsToCloseWindows(true);
+ m_page->setDeviceScaleFactor(m_webView->deviceScaleFactor());
+ m_page->settings()->setDeviceSupportsTouch(m_webView->page()->settings()->deviceSupportsTouch());
static ContextFeaturesClient* pagePopupFeaturesClient = new PagePopupFeaturesClient();
provideContextFeaturesTo(m_page.get(), pagePopupFeaturesClient);
diff --git a/Source/WebKit/chromium/src/WebPagePopupImpl.h b/Source/WebKit/chromium/src/WebPagePopupImpl.h
index 2e1c8c3f3..2552bacf1 100644
--- a/Source/WebKit/chromium/src/WebPagePopupImpl.h
+++ b/Source/WebKit/chromium/src/WebPagePopupImpl.h
@@ -63,6 +63,7 @@ public:
bool handleKeyEvent(const WebCore::PlatformKeyboardEvent&);
void closePopup();
WebWidgetClient* widgetClient() const { return m_widgetClient; }
+ bool hasSamePopupClient(WebPagePopupImpl* other) { return other && m_popupClient == other->m_popupClient; }
private:
// WebWidget functions
diff --git a/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp b/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp
index 491a30311..ec08f0a0e 100644
--- a/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp
+++ b/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp
@@ -462,7 +462,7 @@ bool WebRuntimeFeatures::isVideoTrackEnabled()
void WebRuntimeFeatures::enableGamepad(bool enable)
{
#if ENABLE(GAMEPAD)
- RuntimeEnabledFeatures::setWebkitGamepadsEnabled(enable);
+ RuntimeEnabledFeatures::setWebkitGetGamepadsEnabled(enable);
#else
UNUSED_PARAM(enable);
#endif
@@ -471,7 +471,7 @@ void WebRuntimeFeatures::enableGamepad(bool enable)
bool WebRuntimeFeatures::isGamepadEnabled()
{
#if ENABLE(GAMEPAD)
- return RuntimeEnabledFeatures::webkitGamepadsEnabled();
+ return RuntimeEnabledFeatures::webkitGetGamepadsEnabled();
#else
return false;
#endif
@@ -531,6 +531,96 @@ bool WebRuntimeFeatures::isInputTypeDateEnabled()
#endif
}
+void WebRuntimeFeatures::enableInputTypeDateTime(bool enable)
+{
+#if ENABLE(INPUT_TYPE_DATETIME)
+ RuntimeEnabledFeatures::setInputTypeDateTimeEnabled(enable);
+#else
+ UNUSED_PARAM(enable);
+#endif
+}
+
+bool WebRuntimeFeatures::isInputTypeDateTimeEnabled()
+{
+#if ENABLE(INPUT_TYPE_DATETIME)
+ return RuntimeEnabledFeatures::inputTypeDateTimeEnabled();
+#else
+ return false;
+#endif
+}
+
+void WebRuntimeFeatures::enableInputTypeDateTimeLocal(bool enable)
+{
+#if ENABLE(INPUT_TYPE_DATETIMELOCAL)
+ RuntimeEnabledFeatures::setInputTypeDateTimeLocalEnabled(enable);
+#else
+ UNUSED_PARAM(enable);
+#endif
+}
+
+bool WebRuntimeFeatures::isInputTypeDateTimeLocalEnabled()
+{
+#if ENABLE(INPUT_TYPE_DATETIMELOCAL)
+ return RuntimeEnabledFeatures::inputTypeDateTimeLocalEnabled();
+#else
+ return false;
+#endif
+}
+
+void WebRuntimeFeatures::enableInputTypeMonth(bool enable)
+{
+#if ENABLE(INPUT_TYPE_MONTH)
+ RuntimeEnabledFeatures::setInputTypeMonthEnabled(enable);
+#else
+ UNUSED_PARAM(enable);
+#endif
+}
+
+bool WebRuntimeFeatures::isInputTypeMonthEnabled()
+{
+#if ENABLE(INPUT_TYPE_MONTH)
+ return RuntimeEnabledFeatures::inputTypeMonthEnabled();
+#else
+ return false;
+#endif
+}
+
+void WebRuntimeFeatures::enableInputTypeTime(bool enable)
+{
+#if ENABLE(INPUT_TYPE_TIME)
+ RuntimeEnabledFeatures::setInputTypeTimeEnabled(enable);
+#else
+ UNUSED_PARAM(enable);
+#endif
+}
+
+bool WebRuntimeFeatures::isInputTypeTimeEnabled()
+{
+#if ENABLE(INPUT_TYPE_TIME)
+ return RuntimeEnabledFeatures::inputTypeTimeEnabled();
+#else
+ return false;
+#endif
+}
+
+void WebRuntimeFeatures::enableInputTypeWeek(bool enable)
+{
+#if ENABLE(INPUT_TYPE_WEEK)
+ RuntimeEnabledFeatures::setInputTypeWeekEnabled(enable);
+#else
+ UNUSED_PARAM(enable);
+#endif
+}
+
+bool WebRuntimeFeatures::isInputTypeWeekEnabled()
+{
+#if ENABLE(INPUT_TYPE_WEEK)
+ return RuntimeEnabledFeatures::inputTypeWeekEnabled();
+#else
+ return false;
+#endif
+}
+
void WebRuntimeFeatures::enableDialogElement(bool enable)
{
#if ENABLE(DIALOG_ELEMENT)
diff --git a/Source/WebKit/chromium/src/WebViewBenchmarkSupportImpl.cpp b/Source/WebKit/chromium/src/WebViewBenchmarkSupportImpl.cpp
index 2b11f6eb6..9764af138 100644
--- a/Source/WebKit/chromium/src/WebViewBenchmarkSupportImpl.cpp
+++ b/Source/WebKit/chromium/src/WebViewBenchmarkSupportImpl.cpp
@@ -47,12 +47,11 @@ namespace WebKit {
void WebViewBenchmarkSupportImpl::paintLayer(PaintClient* paintClient, GraphicsLayer& layer, const IntRect& clip)
{
WebSize canvasSize(clip.width(), clip.height());
- OwnPtr<WebCanvas> canvas = adoptPtr(paintClient->createCanvas(canvasSize));
- GraphicsContextBuilder builder(canvas.get());
+ WebCanvas* canvas = paintClient->willPaint(canvasSize);
+ GraphicsContextBuilder builder(canvas);
- paintClient->willPaint(*canvas.get());
layer.paintGraphicsLayerContents(builder.context(), clip);
- paintClient->didPaint(*canvas.get());
+ paintClient->didPaint(canvas);
}
void WebViewBenchmarkSupportImpl::acceleratedPaintUnclipped(PaintClient* paintClient, GraphicsLayer& layer)
@@ -84,10 +83,9 @@ void WebViewBenchmarkSupportImpl::softwarePaint(PaintClient* paintClient, PaintM
}
WebSize canvasSize(paintSize.width, paintSize.height);
- OwnPtr<WebCanvas> canvas = adoptPtr(paintClient->createCanvas(canvasSize));
- paintClient->willPaint(*canvas.get());
- m_webViewImpl->paint(canvas.get(), paintSize);
- paintClient->didPaint(*canvas.get());
+ WebCanvas* canvas = paintClient->willPaint(canvasSize);
+ m_webViewImpl->paint(canvas, paintSize);
+ paintClient->didPaint(canvas);
}
void WebViewBenchmarkSupportImpl::paint(PaintClient* paintClient, PaintMode paintMode)
diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp
index 6a253f8e3..7c6da60d9 100644
--- a/Source/WebKit/chromium/src/WebViewImpl.cpp
+++ b/Source/WebKit/chromium/src/WebViewImpl.cpp
@@ -197,6 +197,8 @@ static const float doubleTapZoomContentDefaultMargin = 5;
static const float doubleTapZoomContentMinimumMargin = 2;
static const double doubleTabZoomAnimationDurationInSeconds = 0.25;
+// Constants for zooming in on a focused text field.
+static const double scrollAndScaleAnimationDurationInSeconds = 0.2;
namespace WebKit {
@@ -392,6 +394,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
, m_maximumPageScaleFactor(maxPageScaleFactor)
, m_ignoreViewportTagMaximumScale(false)
, m_pageScaleFactorIsSet(false)
+ , m_savedPageScaleFactor(0)
, m_contextMenuAllowed(false)
, m_doingDragAndDrop(false)
, m_ignoreInputEvents(false)
@@ -522,14 +525,23 @@ void WebViewImpl::handleMouseLeave(Frame& mainFrame, const WebMouseEvent& event)
void WebViewImpl::handleMouseDown(Frame& mainFrame, const WebMouseEvent& event)
{
- // If there is a select popup open, close it as the user is clicking on
- // the page (outside of the popup). We also save it so we can prevent a
- // click on the select element from immediately reopening the popup.
+ // If there is a popup open, close it as the user is clicking on the page (outside of the
+ // popup). We also save it so we can prevent a click on an element from immediately
+ // reopening the same popup.
RefPtr<WebCore::PopupContainer> selectPopup;
+#if ENABLE(PAGE_POPUP)
+ RefPtr<WebPagePopupImpl> pagePopup;
+#endif
if (event.button == WebMouseEvent::ButtonLeft) {
selectPopup = m_selectPopup;
- hideSelectPopup();
+#if ENABLE(PAGE_POPUP)
+ pagePopup = m_pagePopup;
+#endif
+ hidePopups();
ASSERT(!m_selectPopup);
+#if ENABLE(PAGE_POPUP)
+ ASSERT(!m_pagePopup);
+#endif
}
m_lastMouseDownPoint = WebPoint(event.x, event.y);
@@ -555,6 +567,14 @@ void WebViewImpl::handleMouseDown(Frame& mainFrame, const WebMouseEvent& event)
hideSelectPopup();
}
+#if ENABLE(PAGE_POPUP)
+ if (m_pagePopup && pagePopup && m_pagePopup->hasSamePopupClient(pagePopup.get())) {
+ // That click triggered a page popup that is the same as the one we just closed.
+ // It needs to be closed.
+ closePagePopup(m_pagePopup.get());
+ }
+#endif
+
// Dispatch the contextmenu event regardless of if the click was swallowed.
// On Windows, we handle it on mouse up, not down.
#if OS(DARWIN)
@@ -2713,6 +2733,33 @@ float WebViewImpl::maximumPageScaleFactor() const
return m_maximumPageScaleFactor;
}
+void WebViewImpl::saveScrollAndScaleState()
+{
+ m_savedPageScaleFactor = pageScaleFactor();
+ m_savedScrollOffset = mainFrame()->scrollOffset();
+}
+
+void WebViewImpl::restoreScrollAndScaleState()
+{
+ if (!m_savedPageScaleFactor)
+ return;
+
+#if ENABLE(GESTURE_EVENTS)
+ startPageScaleAnimation(IntPoint(m_savedScrollOffset), false, m_savedPageScaleFactor, scrollAndScaleAnimationDurationInSeconds);
+#else
+ setPageScaleFactor(m_savedPageScaleFactor, WebPoint());
+ mainFrame()->setScrollOffset(m_savedScrollOffset);
+#endif
+
+ resetSavedScrollAndScaleState();
+}
+
+void WebViewImpl::resetSavedScrollAndScaleState()
+{
+ m_savedPageScaleFactor = 0;
+ m_savedScrollOffset = IntSize();
+}
+
WebSize WebViewImpl::fixedLayoutSize() const
{
if (!page())
@@ -3246,6 +3293,7 @@ void WebViewImpl::didCommitLoad(bool* isNewNavigation, bool isNavigationWithinPa
m_pageScaleFactorIsSet = false;
m_gestureAnimation.clear();
+ resetSavedScrollAndScaleState();
}
void WebViewImpl::layoutUpdated(WebFrameImpl* webframe)
diff --git a/Source/WebKit/chromium/src/WebViewImpl.h b/Source/WebKit/chromium/src/WebViewImpl.h
index 1155969fd..639d5e61a 100644
--- a/Source/WebKit/chromium/src/WebViewImpl.h
+++ b/Source/WebKit/chromium/src/WebViewImpl.h
@@ -174,6 +174,7 @@ public:
virtual void didChangeWindowResizerRect();
virtual void instrumentBeginFrame();
virtual void instrumentCancelFrame();
+ virtual void renderingStats(WebRenderingStats&) const;
// WebView methods:
virtual void initializeMainFrame(WebFrameClient*);
@@ -220,6 +221,8 @@ public:
virtual void setPageScaleFactorLimits(float minPageScale, float maxPageScale);
virtual float minimumPageScaleFactor() const;
virtual float maximumPageScaleFactor() const;
+ virtual void saveScrollAndScaleState();
+ virtual void restoreScrollAndScaleState();
virtual void setIgnoreViewportTagMaximumScale(bool);
virtual float deviceScaleFactor() const;
@@ -296,7 +299,6 @@ public:
virtual void updateBatteryStatus(const WebBatteryStatus&);
#endif
virtual void transferActiveWheelFlingAnimation(const WebActiveWheelFlingParameters&);
- virtual void renderingStats(WebRenderingStats&) const;
virtual WebViewBenchmarkSupport* benchmarkSupport();
// WebLayerTreeViewClient
@@ -579,6 +581,8 @@ private:
float clampPageScaleFactorToLimits(float scale);
WebPoint clampOffsetAtScale(const WebPoint& offset, float scale);
+ void resetSavedScrollAndScaleState();
+
friend class WebView; // So WebView::Create can call our constructor
friend class WTF::RefCounted<WebViewImpl>;
@@ -707,15 +711,18 @@ private:
double m_maximumZoomLevel;
+ // State related to the page scale
float m_pageDefinedMinimumPageScaleFactor;
float m_pageDefinedMaximumPageScaleFactor;
float m_minimumPageScaleFactor;
float m_maximumPageScaleFactor;
-
bool m_ignoreViewportTagMaximumScale;
-
bool m_pageScaleFactorIsSet;
+ // Saved page scale state.
+ float m_savedPageScaleFactor; // 0 means that no page scale factor is saved.
+ WebCore::IntSize m_savedScrollOffset;
+
bool m_contextMenuAllowed;
bool m_doingDragAndDrop;
diff --git a/Source/WebKit/chromium/tests/CCDamageTrackerTest.cpp b/Source/WebKit/chromium/tests/CCDamageTrackerTest.cpp
index 9aa412090..8294ca622 100644
--- a/Source/WebKit/chromium/tests/CCDamageTrackerTest.cpp
+++ b/Source/WebKit/chromium/tests/CCDamageTrackerTest.cpp
@@ -46,8 +46,6 @@ namespace {
void executeCalculateDrawTransformsAndVisibility(CCLayerImpl* root, Vector<CCLayerImpl*>& renderSurfaceLayerList)
{
CCLayerSorter layerSorter;
- WebTransformationMatrix identityMatrix;
- Vector<CCLayerImpl*> dummyLayerList;
int dummyMaxTextureSize = 512;
// Sanity check: The test itself should create the root layer's render surface, so
@@ -56,9 +54,7 @@ void executeCalculateDrawTransformsAndVisibility(CCLayerImpl* root, Vector<CCLay
ASSERT_TRUE(root->renderSurface());
ASSERT_FALSE(renderSurfaceLayerList.size());
- root->renderSurface()->clearLayerList();
- renderSurfaceLayerList.append(root);
- CCLayerTreeHostCommon::calculateDrawTransforms(root, root, identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, &layerSorter, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(root, root->bounds(), 1, &layerSorter, dummyMaxTextureSize, renderSurfaceLayerList);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, root->renderSurface()->contentRect());
}
@@ -99,6 +95,7 @@ PassOwnPtr<CCLayerImpl> createTestTreeWithOneSurface()
root->setPosition(FloatPoint::zero());
root->setAnchorPoint(FloatPoint::zero());
root->setBounds(IntSize(500, 500));
+ root->setContentBounds(IntSize(500, 500));
root->setDrawsContent(true);
root->createRenderSurface();
root->renderSurface()->setContentRect(IntRect(IntPoint(), IntSize(500, 500)));
@@ -106,6 +103,7 @@ PassOwnPtr<CCLayerImpl> createTestTreeWithOneSurface()
child->setPosition(FloatPoint(100, 100));
child->setAnchorPoint(FloatPoint::zero());
child->setBounds(IntSize(30, 30));
+ child->setContentBounds(IntSize(30, 30));
child->setDrawsContent(true);
root->addChild(child.release());
@@ -127,6 +125,7 @@ PassOwnPtr<CCLayerImpl> createTestTreeWithTwoSurfaces()
root->setPosition(FloatPoint::zero());
root->setAnchorPoint(FloatPoint::zero());
root->setBounds(IntSize(500, 500));
+ root->setContentBounds(IntSize(500, 500));
root->setDrawsContent(true);
root->createRenderSurface();
root->renderSurface()->setContentRect(IntRect(IntPoint(), IntSize(500, 500)));
@@ -134,22 +133,26 @@ PassOwnPtr<CCLayerImpl> createTestTreeWithTwoSurfaces()
child1->setPosition(FloatPoint(100, 100));
child1->setAnchorPoint(FloatPoint::zero());
child1->setBounds(IntSize(30, 30));
+ child1->setContentBounds(IntSize(30, 30));
child1->setOpacity(0.5); // with a child that drawsContent, this will cause the layer to create its own renderSurface.
child1->setDrawsContent(false); // this layer does not draw, but is intended to create its own renderSurface.
child2->setPosition(FloatPoint(11, 11));
child2->setAnchorPoint(FloatPoint::zero());
child2->setBounds(IntSize(18, 18));
+ child2->setContentBounds(IntSize(18, 18));
child2->setDrawsContent(true);
grandChild1->setPosition(FloatPoint(200, 200));
grandChild1->setAnchorPoint(FloatPoint::zero());
grandChild1->setBounds(IntSize(6, 8));
+ grandChild1->setContentBounds(IntSize(6, 8));
grandChild1->setDrawsContent(true);
grandChild2->setPosition(FloatPoint(190, 190));
grandChild2->setAnchorPoint(FloatPoint::zero());
grandChild2->setBounds(IntSize(6, 8));
+ grandChild2->setContentBounds(IntSize(6, 8));
grandChild2->setDrawsContent(true);
child1->addChild(grandChild1.release());
@@ -360,6 +363,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForPerspectiveClippedLayer)
// Set up the child
child->setPosition(FloatPoint(0, 0));
child->setBounds(IntSize(100, 100));
+ child->setContentBounds(IntSize(100, 100));
child->setTransform(transform);
emulateDrawingOneFrame(root.get());
@@ -526,6 +530,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForAddingAndRemovingLayer)
child2->setPosition(FloatPoint(400, 380));
child2->setAnchorPoint(FloatPoint::zero());
child2->setBounds(IntSize(6, 8));
+ child2->setContentBounds(IntSize(6, 8));
child2->setDrawsContent(true);
root->addChild(child2.release());
}
@@ -565,6 +570,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForNewUnchangedLayer)
child2->setPosition(FloatPoint(400, 380));
child2->setAnchorPoint(FloatPoint::zero());
child2->setBounds(IntSize(6, 8));
+ child2->setContentBounds(IntSize(6, 8));
child2->setDrawsContent(true);
child2->resetAllChangeTrackingForSubtree();
// Sanity check the initial conditions of the test, if these asserts trigger, it
@@ -594,6 +600,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForMultipleLayers)
child2->setPosition(FloatPoint(400, 380));
child2->setAnchorPoint(FloatPoint::zero());
child2->setBounds(IntSize(6, 8));
+ child2->setContentBounds(IntSize(6, 8));
child2->setDrawsContent(true);
root->addChild(child2.release());
}
@@ -812,6 +819,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForReplica)
grandChild3->setPosition(FloatPoint(240, 240));
grandChild3->setAnchorPoint(FloatPoint::zero());
grandChild3->setBounds(IntSize(10, 10));
+ grandChild3->setContentBounds(IntSize(10, 10));
grandChild3->setDrawsContent(true);
child1->addChild(grandChild3.release());
}
@@ -894,6 +902,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForMask)
maskLayer->setPosition(child->position());
maskLayer->setAnchorPoint(FloatPoint::zero());
maskLayer->setBounds(child->bounds());
+ maskLayer->setContentBounds(child->bounds());
child->setMaskLayer(maskLayer.release());
}
CCLayerImpl* maskLayer = child->maskLayer();
@@ -905,6 +914,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForMask)
grandChild->setPosition(FloatPoint(2, 2));
grandChild->setAnchorPoint(FloatPoint::zero());
grandChild->setBounds(IntSize(2, 2));
+ grandChild->setContentBounds(IntSize(2, 2));
grandChild->setDrawsContent(true);
child->addChild(grandChild.release());
}
@@ -989,6 +999,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForReplicaMask)
replicaMaskLayer->setPosition(FloatPoint::zero());
replicaMaskLayer->setAnchorPoint(FloatPoint::zero());
replicaMaskLayer->setBounds(grandChild1->bounds());
+ replicaMaskLayer->setContentBounds(grandChild1->bounds());
grandChild1Replica->setMaskLayer(replicaMaskLayer.release());
}
CCLayerImpl* replicaMaskLayer = grandChild1Replica->maskLayer();
@@ -1050,6 +1061,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForReplicaMaskWithAnchor)
replicaMaskLayer->setPosition(FloatPoint::zero());
replicaMaskLayer->setAnchorPoint(FloatPoint::zero()); // note, this is not the anchor being tested.
replicaMaskLayer->setBounds(grandChild1->bounds());
+ replicaMaskLayer->setContentBounds(grandChild1->bounds());
grandChild1Replica->setMaskLayer(replicaMaskLayer.release());
}
CCLayerImpl* replicaMaskLayer = grandChild1Replica->maskLayer();
diff --git a/Source/WebKit/chromium/tests/CCLayerIteratorTest.cpp b/Source/WebKit/chromium/tests/CCLayerIteratorTest.cpp
index 76dc425aa..73fda4cb4 100644
--- a/Source/WebKit/chromium/tests/CCLayerIteratorTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerIteratorTest.cpp
@@ -147,12 +147,7 @@ TEST(CCLayerIteratorTest, simpleTree)
rootLayer->addChild(fourth);
Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
- Vector<RefPtr<LayerChromium> > layerList;
- renderSurfaceLayerList.append(rootLayer.get());
- CCLayerTreeHostCommon::calculateDrawTransforms(rootLayer.get(), rootLayer.get(),
- WebTransformationMatrix(), WebTransformationMatrix(),
- renderSurfaceLayerList, layerList,
- 256);
+ CCLayerTreeHostCommon::calculateDrawTransforms(rootLayer.get(), rootLayer->bounds(), 1, 256, renderSurfaceLayerList);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, rootLayer->renderSurface()->contentRect());
iterateBackToFront(&renderSurfaceLayerList);
@@ -195,12 +190,7 @@ TEST(CCLayerIteratorTest, complexTree)
root23->addChild(root231);
Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
- Vector<RefPtr<LayerChromium> > layerList;
- renderSurfaceLayerList.append(rootLayer.get());
- CCLayerTreeHostCommon::calculateDrawTransforms(rootLayer.get(), rootLayer.get(),
- WebTransformationMatrix(), WebTransformationMatrix(),
- renderSurfaceLayerList, layerList,
- 256);
+ CCLayerTreeHostCommon::calculateDrawTransforms(rootLayer.get(), rootLayer->bounds(), 1, 256, renderSurfaceLayerList);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, rootLayer->renderSurface()->contentRect());
iterateBackToFront(&renderSurfaceLayerList);
@@ -256,13 +246,7 @@ TEST(CCLayerIteratorTest, complexTreeMultiSurface)
root23->addChild(root231);
Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
- Vector<RefPtr<LayerChromium> > layerList;
- renderSurfaceLayerList.append(rootLayer.get());
-
- CCLayerTreeHostCommon::calculateDrawTransforms(rootLayer.get(), rootLayer.get(),
- WebTransformationMatrix(), WebTransformationMatrix(),
- renderSurfaceLayerList, layerList,
- 256);
+ CCLayerTreeHostCommon::calculateDrawTransforms(rootLayer.get(), rootLayer->bounds(), 1, 256, renderSurfaceLayerList);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, rootLayer->renderSurface()->contentRect());
iterateBackToFront(&renderSurfaceLayerList);
diff --git a/Source/WebKit/chromium/tests/CCLayerSorterTest.cpp b/Source/WebKit/chromium/tests/CCLayerSorterTest.cpp
index d231e1259..8ffcea24f 100644
--- a/Source/WebKit/chromium/tests/CCLayerSorterTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerSorterTest.cpp
@@ -89,9 +89,11 @@ TEST(CCLayerSorterTest, RightAngleOverlap)
WebTransformationMatrix leftFaceMatrix;
leftFaceMatrix.rotate3d(0, 1, 0, -90);
leftFaceMatrix.translateRight3d(-1, 0, -5);
+ leftFaceMatrix.translate(-1, -1);
CCLayerSorter::LayerShape leftFace(2, 2, perspectiveMatrix * leftFaceMatrix);
WebTransformationMatrix frontFaceMatrix;
frontFaceMatrix.translate3d(0, 0, -4);
+ frontFaceMatrix.translate(-1, -1);
CCLayerSorter::LayerShape frontFace(2, 2, perspectiveMatrix * frontFaceMatrix);
overlapResult = CCLayerSorter::checkOverlap(&frontFace, &leftFace, zThreshold, weight);
@@ -111,11 +113,13 @@ TEST(CCLayerSorterTest, IntersectingLayerOverlap)
// values at the overlapping features but the weight returned should be zero.
WebTransformationMatrix frontFaceMatrix;
frontFaceMatrix.translate3d(0, 0, -4);
+ frontFaceMatrix.translate(-1, -1);
CCLayerSorter::LayerShape frontFace(2, 2, perspectiveMatrix * frontFaceMatrix);
WebTransformationMatrix throughMatrix;
throughMatrix.rotate3d(0, 1, 0, 45);
throughMatrix.translateRight3d(0, 0, -4);
+ throughMatrix.translate(-1, -1);
CCLayerSorter::LayerShape rotatedFace(2, 2, perspectiveMatrix * throughMatrix);
overlapResult = CCLayerSorter::checkOverlap(&frontFace, &rotatedFace, zThreshold, weight);
EXPECT_NE(CCLayerSorter::None, overlapResult);
@@ -142,14 +146,17 @@ TEST(CCLayerSorterTest, LayersAtAngleOverlap)
WebTransformationMatrix transformA;
transformA.translate3d(-6, 0, 1);
+ transformA.translate(-4, -10);
CCLayerSorter::LayerShape layerA(8, 20, transformA);
WebTransformationMatrix transformB;
transformB.translate3d(6, 0, -1);
+ transformB.translate(-4, -10);
CCLayerSorter::LayerShape layerB(8, 20, transformB);
WebTransformationMatrix transformC;
transformC.rotate3d(0, 1, 0, 40);
+ transformC.translate(-4, -10);
CCLayerSorter::LayerShape layerC(8, 20, transformC);
overlapResult = CCLayerSorter::checkOverlap(&layerA, &layerC, zThreshold, weight);
@@ -176,6 +183,7 @@ TEST(CCLayerSorterTest, LayersUnderPathologicalPerspectiveTransform)
WebTransformationMatrix transformA;
transformA.translate3d(-15, 0, -2);
+ transformA.translate(-5, -5);
CCLayerSorter::LayerShape layerA(10, 10, perspectiveMatrix * transformA);
// With this sequence of transforms, when layer B is correctly clipped, it will be
@@ -185,6 +193,7 @@ TEST(CCLayerSorterTest, LayersUnderPathologicalPerspectiveTransform)
WebTransformationMatrix transformB;
transformB.translate3d(0, 0, 0.7);
transformB.rotate3d(0, 45, 0);
+ transformB.translate(-5, -5);
CCLayerSorter::LayerShape layerB(10, 10, perspectiveMatrix * transformB);
// Sanity check that the test case actually covers the intended scenario, where part
@@ -226,22 +235,27 @@ TEST(CCLayerSorterTest, verifyExistingOrderingPreservedWhenNoZDiff)
FrontMatrix.translate3d(0, 0, 1);
layer1->setBounds(IntSize(10, 10));
+ layer1->setContentBounds(IntSize(10, 10));
layer1->setDrawTransform(BehindMatrix);
layer1->setDrawsContent(true);
layer2->setBounds(IntSize(20, 20));
+ layer2->setContentBounds(IntSize(20, 20));
layer2->setDrawTransform(BehindMatrix);
layer2->setDrawsContent(true);
layer3->setBounds(IntSize(30, 30));
+ layer3->setContentBounds(IntSize(30, 30));
layer3->setDrawTransform(FrontMatrix);
layer3->setDrawsContent(true);
layer4->setBounds(IntSize(40, 40));
+ layer4->setContentBounds(IntSize(40, 40));
layer4->setDrawTransform(FrontMatrix);
layer4->setDrawsContent(true);
layer5->setBounds(IntSize(50, 50));
+ layer5->setContentBounds(IntSize(50, 50));
layer5->setDrawTransform(BehindMatrix);
layer5->setDrawsContent(true);
diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp
index 86af40a02..9e249f2d7 100644
--- a/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp
@@ -75,25 +75,25 @@ void executeCalculateDrawTransformsAndVisibility(LayerChromium* rootLayer)
{
WebTransformationMatrix identityMatrix;
Vector<RefPtr<LayerChromium> > dummyRenderSurfaceLayerList;
- Vector<RefPtr<LayerChromium> > dummyLayerList;
int dummyMaxTextureSize = 512;
- ASSERT(rootLayer->renderSurface());
+ // We are probably not testing what is intended if the rootLayer bounds are empty.
ASSERT(!rootLayer->bounds().isEmpty());
- rootLayer->renderSurface()->setContentRect(IntRect(IntPoint(), rootLayer->bounds()));
-
- CCLayerTreeHostCommon::calculateDrawTransforms(rootLayer, rootLayer, identityMatrix, identityMatrix, dummyRenderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(rootLayer, rootLayer->bounds(), 1, dummyMaxTextureSize, dummyRenderSurfaceLayerList);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(dummyRenderSurfaceLayerList, rootLayer->renderSurface()->contentRect());
}
void executeCalculateDrawTransformsAndVisibility(CCLayerImpl* rootLayer)
{
// Note: this version skips layer sorting.
+
WebTransformationMatrix identityMatrix;
Vector<CCLayerImpl*> dummyRenderSurfaceLayerList;
- Vector<CCLayerImpl*> dummyLayerList;
int dummyMaxTextureSize = 512;
- CCLayerTreeHostCommon::calculateDrawTransforms(rootLayer, rootLayer, identityMatrix, identityMatrix, dummyRenderSurfaceLayerList, dummyLayerList, 0, dummyMaxTextureSize);
+
+ // We are probably not testing what is intended if the rootLayer bounds are empty.
+ ASSERT(!rootLayer->bounds().isEmpty());
+ CCLayerTreeHostCommon::calculateDrawTransforms(rootLayer, rootLayer->bounds(), 1, 0, dummyMaxTextureSize, dummyRenderSurfaceLayerList);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(dummyRenderSurfaceLayerList, rootLayer->renderSurface()->contentRect());
}
@@ -129,8 +129,6 @@ PassOwnPtr<CCLayerImpl> createTreeForFixedPositionTests()
grandChild->addChild(greatGrandChild.release());
child->addChild(grandChild.release());
root->addChild(child.release());
- root->createRenderSurface();
- root->renderSurface()->setContentRect(IntRect(IntPoint::zero(), root->bounds()));
return root.release();
}
@@ -155,7 +153,6 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForNoOpLayer)
RefPtr<LayerChromium> parent = LayerChromium::create();
RefPtr<LayerChromium> child = LayerChromium::create();
RefPtr<LayerChromium> grandChild = LayerChromium::create();
- parent->createRenderSurface();
parent->addChild(child);
child->addChild(grandChild);
@@ -176,7 +173,6 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSingleLayer)
{
WebTransformationMatrix identityMatrix;
RefPtr<LayerChromium> layer = LayerChromium::create();
- layer->createRenderSurface();
// Case 1: setting the sublayer transform should not affect this layer's draw transform or screen-space transform.
WebTransformationMatrix arbitraryTranslation;
@@ -184,31 +180,29 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSingleLayer)
setLayerPropertiesForTesting(layer.get(), identityMatrix, arbitraryTranslation, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
executeCalculateDrawTransformsAndVisibility(layer.get());
WebTransformationMatrix expectedDrawTransform = identityMatrix;
- expectedDrawTransform.translate(50, 50);
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedDrawTransform, layer->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, layer->screenSpaceTransform());
- // Case 2: setting the bounds of the layer should result in a draw transform that translates to half the width and height.
- // The screen-space transform should remain as the identity, because it does not deal with transforming to/from the center of the layer.
+ // Case 2: Setting the bounds of the layer should not affect either the draw transform or the screenspace transform.
WebTransformationMatrix translationToCenter;
translationToCenter.translate(5, 6);
setLayerPropertiesForTesting(layer.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(10, 12), false);
executeCalculateDrawTransformsAndVisibility(layer.get());
- EXPECT_TRANSFORMATION_MATRIX_EQ(translationToCenter, layer->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, layer->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, layer->screenSpaceTransform());
// Case 3: The anchor point by itself (without a layer transform) should have no effect on the transforms.
setLayerPropertiesForTesting(layer.get(), identityMatrix, identityMatrix, FloatPoint(0.25, 0.25), FloatPoint(0, 0), IntSize(10, 12), false);
executeCalculateDrawTransformsAndVisibility(layer.get());
- EXPECT_TRANSFORMATION_MATRIX_EQ(translationToCenter, layer->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, layer->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, layer->screenSpaceTransform());
// Case 4: A change in actual position affects both the draw transform and screen space transform.
WebTransformationMatrix positionTransform;
positionTransform.translate(0, 1.2);
- setLayerPropertiesForTesting(layer.get(), identityMatrix, identityMatrix, FloatPoint(0.25, 0.25), FloatPoint(0, 1.2), IntSize(10, 12), false);
+ setLayerPropertiesForTesting(layer.get(), identityMatrix, identityMatrix, FloatPoint(0.25, 0.25), FloatPoint(0, 1.2f), IntSize(10, 12), false);
executeCalculateDrawTransformsAndVisibility(layer.get());
- EXPECT_TRANSFORMATION_MATRIX_EQ(positionTransform * translationToCenter, layer->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(positionTransform, layer->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(positionTransform, layer->screenSpaceTransform());
// Case 5: In the correct sequence of transforms, the layer transform should pre-multiply the translationToCenter. This is easily tested by
@@ -217,7 +211,7 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSingleLayer)
layerTransform.scale3d(2, 2, 1);
setLayerPropertiesForTesting(layer.get(), layerTransform, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(10, 12), false);
executeCalculateDrawTransformsAndVisibility(layer.get());
- EXPECT_TRANSFORMATION_MATRIX_EQ(layerTransform * translationToCenter, layer->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(layerTransform, layer->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(layerTransform, layer->screenSpaceTransform());
// Case 6: The layer transform should occur with respect to the anchor point.
@@ -226,16 +220,16 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSingleLayer)
WebTransformationMatrix expectedResult = translationToAnchor * layerTransform * translationToAnchor.inverse();
setLayerPropertiesForTesting(layer.get(), layerTransform, identityMatrix, FloatPoint(0.5, 0), FloatPoint(0, 0), IntSize(10, 12), false);
executeCalculateDrawTransformsAndVisibility(layer.get());
- EXPECT_TRANSFORMATION_MATRIX_EQ(expectedResult * translationToCenter, layer->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedResult, layer->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedResult, layer->screenSpaceTransform());
// Case 7: Verify that position pre-multiplies the layer transform.
// The current implementation of calculateDrawTransforms does this implicitly, but it is
// still worth testing to detect accidental regressions.
expectedResult = positionTransform * translationToAnchor * layerTransform * translationToAnchor.inverse();
- setLayerPropertiesForTesting(layer.get(), layerTransform, identityMatrix, FloatPoint(0.5, 0), FloatPoint(0, 1.2), IntSize(10, 12), false);
+ setLayerPropertiesForTesting(layer.get(), layerTransform, identityMatrix, FloatPoint(0.5, 0), FloatPoint(0, 1.2f), IntSize(10, 12), false);
executeCalculateDrawTransformsAndVisibility(layer.get());
- EXPECT_TRANSFORMATION_MATRIX_EQ(expectedResult * translationToCenter, layer->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedResult, layer->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedResult, layer->screenSpaceTransform());
}
@@ -245,33 +239,29 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSimpleHierarchy)
RefPtr<LayerChromium> parent = LayerChromium::create();
RefPtr<LayerChromium> child = LayerChromium::create();
RefPtr<LayerChromium> grandChild = LayerChromium::create();
- parent->createRenderSurface();
parent->addChild(child);
child->addChild(grandChild);
// Case 1: parent's anchorPoint should not affect child or grandChild.
- WebTransformationMatrix childTranslationToCenter, grandChildTranslationToCenter;
- childTranslationToCenter.translate(8, 9);
- grandChildTranslationToCenter.translate(38, 39);
setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0.25, 0.25), FloatPoint(0, 0), IntSize(10, 12), false);
setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(16, 18), false);
setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(76, 78), false);
executeCalculateDrawTransformsAndVisibility(parent.get());
- EXPECT_TRANSFORMATION_MATRIX_EQ(childTranslationToCenter, child->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, child->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, child->screenSpaceTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(grandChildTranslationToCenter, grandChild->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, grandChild->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, grandChild->screenSpaceTransform());
// Case 2: parent's position affects child and grandChild.
WebTransformationMatrix parentPositionTransform;
parentPositionTransform.translate(0, 1.2);
- setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0.25, 0.25), FloatPoint(0, 1.2), IntSize(10, 12), false);
+ setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0.25, 0.25), FloatPoint(0, 1.2f), IntSize(10, 12), false);
setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(16, 18), false);
setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(76, 78), false);
executeCalculateDrawTransformsAndVisibility(parent.get());
- EXPECT_TRANSFORMATION_MATRIX_EQ(parentPositionTransform * childTranslationToCenter, child->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(parentPositionTransform, child->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(parentPositionTransform, child->screenSpaceTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(parentPositionTransform * grandChildTranslationToCenter, grandChild->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(parentPositionTransform, grandChild->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(parentPositionTransform, grandChild->screenSpaceTransform());
// Case 3: parent's local transform affects child and grandchild
@@ -284,9 +274,9 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSimpleHierarchy)
setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(16, 18), false);
setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(76, 78), false);
executeCalculateDrawTransformsAndVisibility(parent.get());
- EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform * childTranslationToCenter, child->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform, child->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform, child->screenSpaceTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform * grandChildTranslationToCenter, grandChild->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform, grandChild->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform, grandChild->screenSpaceTransform());
// Case 4: parent's sublayerMatrix affects child and grandchild
@@ -305,9 +295,9 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSimpleHierarchy)
setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(16, 18), false);
setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(76, 78), false);
executeCalculateDrawTransformsAndVisibility(parent.get());
- EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform * childTranslationToCenter, child->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform, child->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform, child->screenSpaceTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(flattenedCompositeTransform * grandChildTranslationToCenter, grandChild->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(flattenedCompositeTransform, grandChild->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(flattenedCompositeTransform, grandChild->screenSpaceTransform());
// Case 5: same as Case 4, except that child does preserve 3D, so the grandChild should receive the non-flattened composite transform.
@@ -316,9 +306,9 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSimpleHierarchy)
setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(16, 18), true);
setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(76, 78), false);
executeCalculateDrawTransformsAndVisibility(parent.get());
- EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform * childTranslationToCenter, child->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform, child->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform, child->screenSpaceTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform * grandChildTranslationToCenter, grandChild->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform, grandChild->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform, grandChild->screenSpaceTransform());
}
@@ -327,7 +317,6 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSingleRenderSurface)
RefPtr<LayerChromium> parent = LayerChromium::create();
RefPtr<LayerChromium> child = LayerChromium::create();
RefPtr<LayerChromiumWithForcedDrawsContent> grandChild = adoptRef(new LayerChromiumWithForcedDrawsContent());
- parent->createRenderSurface();
parent->addChild(child);
child->addChild(grandChild);
@@ -346,11 +335,6 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSingleRenderSurface)
WebTransformationMatrix parentCompositeTransform = parentTranslationToAnchor * parentLayerTransform * parentTranslationToAnchor.inverse()
* parentTranslationToCenter * parentSublayerMatrix * parentTranslationToCenter.inverse();
- WebTransformationMatrix childTranslationToCenter;
- childTranslationToCenter.translate(8, 9);
- WebTransformationMatrix grandChildTranslationToCenter;
- grandChildTranslationToCenter.translate(4, 5);
-
// Child's render surface should not exist yet.
ASSERT_FALSE(child->renderSurface());
@@ -363,16 +347,13 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSingleRenderSurface)
ASSERT_TRUE(child->renderSurface());
ASSERT_EQ(child, child->renderTarget());
- // The child layer's draw transform should refer to its new render surface; they only differ by a translation to center.
+ // The child layer's draw transform should refer to its new render surface.
// The screen-space transform, however, should still refer to the root.
- EXPECT_TRANSFORMATION_MATRIX_EQ(childTranslationToCenter, child->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, child->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform, child->screenSpaceTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform, child->renderTarget()->renderSurface()->originTransform());
-
// Because the grandChild is the only drawable content, the child's renderSurface will tighten its bounds to the grandChild.
- // Therefore, the draw transform will have a translation of half-width, half-height of the grandChild's bounds.
- EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform * grandChildTranslationToCenter, child->renderTarget()->renderSurface()->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform, child->renderTarget()->renderSurface()->drawTransform());
// The screen space is the same as the target since the child surface draws into the root.
EXPECT_TRANSFORMATION_MATRIX_EQ(parentCompositeTransform, child->renderTarget()->renderSurface()->screenSpaceTransform());
@@ -408,22 +389,23 @@ TEST(CCLayerTreeHostCommonTest, scissorRectWithClip)
IntRect childRect(10, 10, 50, 50);
IntRect grandChildRect(5, 5, 150, 150);
- root->createRenderSurface();
root->setAnchorPoint(FloatPoint(0, 0));
root->setPosition(FloatPoint(rootRect.x(), rootRect.y()));
root->setBounds(IntSize(rootRect.width(), rootRect.height()));
+ root->setContentBounds(root->bounds());
root->setDrawsContent(true);
- root->renderSurface()->setContentRect(IntRect(IntPoint(), IntSize(rootRect.width(), rootRect.height())));
child->setAnchorPoint(FloatPoint(0, 0));
child->setPosition(FloatPoint(childRect.x(), childRect.y()));
child->setOpacity(0.5);
child->setBounds(IntSize(childRect.width(), childRect.height()));
+ child->setContentBounds(child->bounds());
child->setDrawsContent(true);
grandChild->setAnchorPoint(FloatPoint(0, 0));
grandChild->setPosition(IntPoint(grandChildRect.x(), grandChildRect.y()));
grandChild->setBounds(IntSize(grandChildRect.width(), grandChildRect.height()));
+ grandChild->setContentBounds(grandChild->bounds());
grandChild->setDrawsContent(true);
CCLayerImpl* childPtr = child.get();
@@ -436,14 +418,9 @@ TEST(CCLayerTreeHostCommonTest, scissorRectWithClip)
Vector<CCLayerImpl*> renderSurfaceLayerList;
{
- WebTransformationMatrix identityMatrix;
- Vector<CCLayerImpl*> layerList;
int dummyMaxTextureSize = 512;
CCLayerSorter layerSorter;
-
- renderSurfaceLayerList.append(root.get());
-
- CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, layerList, &layerSorter, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root->bounds(), 1, &layerSorter, dummyMaxTextureSize, renderSurfaceLayerList);
FloatRect dummyDamageRect;
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, dummyDamageRect);
@@ -575,29 +552,31 @@ TEST(CCLayerTreeHostCommonTest, scissorRectWithClipAndSpaceTransform)
IntRect childRect(10, 10, 50, 50);
IntRect grandChildRect(5, 5, 150, 150);
- root->createRenderSurface();
root->setAnchorPoint(FloatPoint(0, 0));
root->setPosition(FloatPoint(rootRect.x(), rootRect.y()));
root->setBounds(IntSize(rootRect.width(), rootRect.height()));
+ root->setContentBounds(root->bounds());
root->setDrawsContent(true);
- root->renderSurface()->setContentRect(IntRect(IntPoint(), IntSize(rootRect.width(), rootRect.height())));
child->setAnchorPoint(FloatPoint(0, 0));
child->setPosition(FloatPoint(childRect.x(), childRect.y()));
child->setOpacity(0.5);
child->setBounds(IntSize(childRect.width(), childRect.height()));
+ child->setContentBounds(child->bounds());
child->setDrawsContent(true);
grandChild->setAnchorPoint(FloatPoint(0, 0));
grandChild->setPosition(IntPoint(grandChildRect.x(), grandChildRect.y()));
grandChild->setOpacity(0.5);
grandChild->setBounds(IntSize(grandChildRect.width(), grandChildRect.height()));
+ grandChild->setContentBounds(grandChild->bounds());
grandChild->setDrawsContent(true);
grandChild2->setAnchorPoint(FloatPoint(0, 0));
grandChild2->setPosition(IntPoint(grandChildRect.x(), grandChildRect.y()));
grandChild2->setOpacity(0.5);
grandChild2->setBounds(IntSize(grandChildRect.width(), grandChildRect.height()));
+ grandChild2->setContentBounds(grandChild2->bounds());
grandChild2->setDrawsContent(true);
CCLayerImpl* childPtr = child.get();
@@ -611,14 +590,9 @@ TEST(CCLayerTreeHostCommonTest, scissorRectWithClipAndSpaceTransform)
Vector<CCLayerImpl*> renderSurfaceLayerList;
{
- WebTransformationMatrix identityMatrix;
- Vector<CCLayerImpl*> layerList;
int dummyMaxTextureSize = 512;
CCLayerSorter layerSorter;
-
- renderSurfaceLayerList.append(root.get());
-
- CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, layerList, &layerSorter, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root->bounds(), 1, &layerSorter, dummyMaxTextureSize, renderSurfaceLayerList);
FloatRect dummyDamageRect;
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, dummyDamageRect);
@@ -729,7 +703,6 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForReplica)
RefPtr<LayerChromium> child = LayerChromium::create();
RefPtr<LayerChromium> childReplica = LayerChromium::create();
RefPtr<LayerChromiumWithForcedDrawsContent> grandChild = adoptRef(new LayerChromiumWithForcedDrawsContent());
- parent->createRenderSurface();
parent->addChild(child);
child->addChild(grandChild);
child->setReplicaLayer(childReplica.get());
@@ -767,7 +740,7 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForReplica)
ASSERT_TRUE(child->renderSurface());
ASSERT_EQ(child, child->renderTarget());
- EXPECT_TRANSFORMATION_MATRIX_EQ(replicaCompositeTransform, child->renderTarget()->renderSurface()->replicaOriginTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(replicaCompositeTransform, child->renderTarget()->renderSurface()->replicaDrawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(replicaCompositeTransform, child->renderTarget()->renderSurface()->replicaScreenSpaceTransform());
}
@@ -791,7 +764,6 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForRenderSurfaceHierarchy)
RefPtr<LayerChromium> grandChildOfRoot = LayerChromium::create();
RefPtr<LayerChromiumWithForcedDrawsContent> grandChildOfRS1 = adoptRef(new LayerChromiumWithForcedDrawsContent());
RefPtr<LayerChromiumWithForcedDrawsContent> grandChildOfRS2 = adoptRef(new LayerChromiumWithForcedDrawsContent());
- parent->createRenderSurface();
parent->addChild(renderSurface1);
parent->addChild(childOfRoot);
renderSurface1->addChild(childOfRS1);
@@ -805,7 +777,7 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForRenderSurfaceHierarchy)
// In combination with descendantDrawsContent, opacity != 1 forces the layer to have a new renderSurface.
renderSurface1->setOpacity(0.5);
- renderSurface2->setOpacity(0.33);
+ renderSurface2->setOpacity(0.33f);
// All layers in the tree are initialized with an anchor at .25 and a size of (10,10).
// matrix "A" is the composite layer transform used in all layers, centered about the anchor point
@@ -828,6 +800,7 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForRenderSurfaceHierarchy)
WebTransformationMatrix A = translationToAnchor * layerTransform * translationToAnchor.inverse();
WebTransformationMatrix B = translationToCenter * sublayerTransform * translationToCenter.inverse();
WebTransformationMatrix R = A * translationToAnchor * replicaLayerTransform * translationToAnchor.inverse();
+ WebTransformationMatrix identityMatrix;
setLayerPropertiesForTesting(parent.get(), layerTransform, sublayerTransform, FloatPoint(0.25, 0), FloatPoint(0, 0), IntSize(10, 10), false);
setLayerPropertiesForTesting(renderSurface1.get(), layerTransform, sublayerTransform, FloatPoint(0.25, 0), FloatPoint(0, 0), IntSize(10, 10), false);
@@ -875,17 +848,17 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForRenderSurfaceHierarchy)
// note that draw transforms are described with respect to the nearest ancestor render surface
// but screen space transforms are described with respect to the root.
//
- EXPECT_TRANSFORMATION_MATRIX_EQ(A * translationToCenter, parent->drawTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(A * B * A * translationToCenter, childOfRoot->drawTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(A * B * A * B * A * translationToCenter, grandChildOfRoot->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(A, parent->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(A * B * A, childOfRoot->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(A * B * A * B * A, grandChildOfRoot->drawTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(translationToCenter, renderSurface1->drawTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(B * A * translationToCenter, childOfRS1->drawTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(B * A * B * A * translationToCenter, grandChildOfRS1->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, renderSurface1->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(B * A, childOfRS1->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(B * A * B * A, grandChildOfRS1->drawTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(translationToCenter, renderSurface2->drawTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(B * A * translationToCenter, childOfRS2->drawTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(B * A * B * A * translationToCenter, grandChildOfRS2->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, renderSurface2->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(B * A, childOfRS2->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(B * A * B * A, grandChildOfRS2->drawTransform());
// Verify layer screen-space transforms
//
@@ -903,14 +876,14 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForRenderSurfaceHierarchy)
// Verify render surface transforms.
//
- // Origin transform of render surface 1 is described with respect to root.
- EXPECT_TRANSFORMATION_MATRIX_EQ(A * B * A, renderSurface1->renderSurface()->originTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(A * B * R, renderSurface1->renderSurface()->replicaOriginTransform());
+ // Draw transform of render surface 1 is described with respect to root.
+ EXPECT_TRANSFORMATION_MATRIX_EQ(A * B * A, renderSurface1->renderSurface()->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(A * B * R, renderSurface1->renderSurface()->replicaDrawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(A * B * A, renderSurface1->renderSurface()->screenSpaceTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(A * B * R, renderSurface1->renderSurface()->replicaScreenSpaceTransform());
- // Origin transform of render surface 2 is described with respect to render surface 2.
- EXPECT_TRANSFORMATION_MATRIX_EQ(B * A, renderSurface2->renderSurface()->originTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(B * R, renderSurface2->renderSurface()->replicaOriginTransform());
+ // Draw transform of render surface 2 is described with respect to render surface 2.
+ EXPECT_TRANSFORMATION_MATRIX_EQ(B * A, renderSurface2->renderSurface()->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(B * R, renderSurface2->renderSurface()->replicaDrawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(A * B * A * B * A, renderSurface2->renderSurface()->screenSpaceTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(A * B * A * B * R, renderSurface2->renderSurface()->replicaScreenSpaceTransform());
@@ -930,37 +903,32 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForRenderSurfaceHierarchy)
EXPECT_FLOAT_EQ(5, grandChildOfRS2->screenSpaceTransform().m42());
}
-TEST(CCLayerTreeHostCommonTest, verifyRenderSurfaceListForClipLayer)
+TEST(CCLayerTreeHostCommonTest, verifyRenderSurfaceListForRenderSurfaceWithClippedLayer)
{
RefPtr<LayerChromium> parent = LayerChromium::create();
RefPtr<LayerChromium> renderSurface1 = LayerChromium::create();
RefPtr<LayerChromiumWithForcedDrawsContent> child = adoptRef(new LayerChromiumWithForcedDrawsContent());
- renderSurface1->setOpacity(0.9);
const WebTransformationMatrix identityMatrix;
setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 10), false);
setLayerPropertiesForTesting(renderSurface1.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 10), false);
setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint(30, 30), IntSize(10, 10), false);
- parent->createRenderSurface();
- parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
parent->addChild(renderSurface1);
- renderSurface1->createRenderSurface();
renderSurface1->addChild(child);
+ renderSurface1->setForceRenderSurface(true);
Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
- Vector<RefPtr<LayerChromium> > dummyLayerList;
int dummyMaxTextureSize = 512;
- CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
-
- FloatRect dummyDamageRect;
+ CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent->bounds(), 1, dummyMaxTextureSize, renderSurfaceLayerList);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, parent->renderSurface()->contentRect());
// The child layer's content is entirely outside the parent's clip rect, so the intermediate
- // render surface should have been removed. Render surfaces without children or visible
+ // render surface should not be listed here, even if it was forced to be created. Render surfaces without children or visible
// content are unexpected at draw time (e.g. we might try to create a content texture of size 0).
+ ASSERT_TRUE(parent->renderSurface());
ASSERT_FALSE(renderSurface1->renderSurface());
- EXPECT_EQ(renderSurfaceLayerList.size(), 0U);
+ EXPECT_EQ(1U, renderSurfaceLayerList.size());
}
TEST(CCLayerTreeHostCommonTest, verifyRenderSurfaceListForTransparentChild)
@@ -968,29 +936,28 @@ TEST(CCLayerTreeHostCommonTest, verifyRenderSurfaceListForTransparentChild)
RefPtr<LayerChromium> parent = LayerChromium::create();
RefPtr<LayerChromium> renderSurface1 = LayerChromium::create();
RefPtr<LayerChromiumWithForcedDrawsContent> child = adoptRef(new LayerChromiumWithForcedDrawsContent());
- renderSurface1->setOpacity(0);
const WebTransformationMatrix identityMatrix;
setLayerPropertiesForTesting(renderSurface1.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 10), false);
setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 10), false);
- parent->createRenderSurface();
parent->addChild(renderSurface1);
- renderSurface1->createRenderSurface();
renderSurface1->addChild(child);
+ renderSurface1->setForceRenderSurface(true);
+ renderSurface1->setOpacity(0);
Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
- Vector<RefPtr<LayerChromium> > dummyLayerList;
int dummyMaxTextureSize = 512;
- CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
-
+ CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent->bounds(), 1, dummyMaxTextureSize, renderSurfaceLayerList);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, parent->renderSurface()->contentRect());
// Since the layer is transparent, renderSurface1->renderSurface() should not have gotten added anywhere.
// Also, the drawable content rect should not have been extended by the children.
- EXPECT_EQ(parent->renderSurface()->layerList().size(), 0U);
- EXPECT_EQ(renderSurfaceLayerList.size(), 0U);
- EXPECT_EQ(parent->drawableContentRect(), IntRect());
+ ASSERT_TRUE(parent->renderSurface());
+ EXPECT_EQ(0U, parent->renderSurface()->layerList().size());
+ EXPECT_EQ(1U, renderSurfaceLayerList.size());
+ EXPECT_EQ(parent->id(), renderSurfaceLayerList[0]->id());
+ EXPECT_EQ(IntRect(), parent->drawableContentRect());
}
TEST(CCLayerTreeHostCommonTest, verifyForceRenderSurface)
@@ -1005,24 +972,28 @@ TEST(CCLayerTreeHostCommonTest, verifyForceRenderSurface)
setLayerPropertiesForTesting(renderSurface1.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 10), false);
setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 10), false);
- parent->createRenderSurface();
- parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
parent->addChild(renderSurface1);
renderSurface1->addChild(child);
+ // Sanity check before the actual test
+ EXPECT_FALSE(parent->renderSurface());
+ EXPECT_FALSE(renderSurface1->renderSurface());
+
Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
- Vector<RefPtr<LayerChromium> > dummyLayerList;
int dummyMaxTextureSize = 512;
- CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent->bounds(), 1, dummyMaxTextureSize, renderSurfaceLayerList);
+ // The root layer always creates a renderSurface
+ EXPECT_TRUE(parent->renderSurface());
EXPECT_TRUE(renderSurface1->renderSurface());
- EXPECT_EQ(renderSurfaceLayerList.size(), 1U);
+ EXPECT_EQ(2U, renderSurfaceLayerList.size());
renderSurfaceLayerList.clear();
renderSurface1->setForceRenderSurface(false);
- CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent->bounds(), 1, dummyMaxTextureSize, renderSurfaceLayerList);
+ EXPECT_TRUE(parent->renderSurface());
EXPECT_FALSE(renderSurface1->renderSurface());
- EXPECT_EQ(renderSurfaceLayerList.size(), 0U);
+ EXPECT_EQ(1U, renderSurfaceLayerList.size());
}
TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWithDirectContainer)
@@ -1042,10 +1013,7 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
child->setScrollDelta(IntSize(0, 0));
executeCalculateDrawTransformsAndVisibility(root.get());
- // The expected drawTransforms without any scroll should still include a translation to the center of the layer (i.e. translation by 50, 50).
WebTransformationMatrix expectedChildTransform;
- expectedChildTransform.translate(50, 50);
-
WebTransformationMatrix expectedGrandChildTransform = expectedChildTransform;
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildTransform, child->drawTransform());
@@ -1057,7 +1025,7 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
// Here the child is affected by scrollDelta, but the fixed position grandChild should not be affected.
expectedChildTransform.makeIdentity();
- expectedChildTransform.translate(40, 40);
+ expectedChildTransform.translate(-10, -10);
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildTransform, child->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGrandChildTransform, grandChild->drawTransform());
@@ -1091,10 +1059,8 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
child->setScrollDelta(IntSize(0, 0));
executeCalculateDrawTransformsAndVisibility(root.get());
- // The expected drawTransforms without any scroll should still include a translation to the center of the layer (i.e. translation by 50, 50).
WebTransformationMatrix expectedChildTransform;
expectedChildTransform.multiply(nonUniformScale);
- expectedChildTransform.translate(50, 50);
WebTransformationMatrix expectedGrandChildTransform = expectedChildTransform;
@@ -1109,7 +1075,6 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
expectedChildTransform.makeIdentity();
expectedChildTransform.translate(-10, -20); // scrollDelta
expectedChildTransform.multiply(nonUniformScale);
- expectedChildTransform.translate(50, 50);
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildTransform, child->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGrandChildTransform, grandChild->drawTransform());
@@ -1135,10 +1100,8 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
executeCalculateDrawTransformsAndVisibility(root.get());
WebTransformationMatrix expectedChildTransform;
- expectedChildTransform.translate(50, 50);
-
WebTransformationMatrix expectedGrandChildTransform;
- expectedGrandChildTransform.translate(58, 56);
+ expectedGrandChildTransform.translate(8, 6);
WebTransformationMatrix expectedGreatGrandChildTransform = expectedGrandChildTransform;
@@ -1152,9 +1115,9 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
// Here the child and grandChild are affected by scrollDelta, but the fixed position greatGrandChild should not be affected.
expectedChildTransform.makeIdentity();
- expectedChildTransform.translate(40, 40);
+ expectedChildTransform.translate(-10, -10);
expectedGrandChildTransform.makeIdentity();
- expectedGrandChildTransform.translate(48, 46);
+ expectedGrandChildTransform.translate(-2, -4);
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildTransform, child->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGrandChildTransform, grandChild->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGreatGrandChildTransform, greatGrandChild->drawTransform());
@@ -1174,7 +1137,7 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
WebTransformationMatrix rotationAboutZ;
rotationAboutZ.rotate3d(0, 0, 90);
-
+
child->setIsContainerForFixedPositionLayers(true);
child->setTransform(rotationAboutZ);
grandChild->setPosition(FloatPoint(8, 6));
@@ -1187,13 +1150,11 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
WebTransformationMatrix expectedChildTransform;
expectedChildTransform.multiply(rotationAboutZ);
- expectedChildTransform.translate(50, 50);
WebTransformationMatrix expectedGrandChildTransform;
expectedGrandChildTransform.multiply(rotationAboutZ); // child's local transform is inherited
expectedGrandChildTransform.translate(8, 6); // translation because of position occurs before layer's local transform.
expectedGrandChildTransform.multiply(rotationAboutZ); // grandChild's local transform
- expectedGrandChildTransform.translate(50, 50); // translation because of half-width half-height occurs after layer's local transform
WebTransformationMatrix expectedGreatGrandChildTransform = expectedGrandChildTransform;
@@ -1209,14 +1170,12 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
expectedChildTransform.makeIdentity();
expectedChildTransform.translate(-10, -20); // scrollDelta
expectedChildTransform.multiply(rotationAboutZ);
- expectedChildTransform.translate(50, 50);
expectedGrandChildTransform.makeIdentity();
expectedGrandChildTransform.translate(-10, -20); // child's scrollDelta is inherited
expectedGrandChildTransform.multiply(rotationAboutZ); // child's local transform is inherited
expectedGrandChildTransform.translate(8, 6); // translation because of position occurs before layer's local transform.
expectedGrandChildTransform.multiply(rotationAboutZ); // grandChild's local transform
- expectedGrandChildTransform.translate(50, 50); // translation because of half-width half-height occurs after layer's local transform
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildTransform, child->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGrandChildTransform, grandChild->drawTransform());
@@ -1240,7 +1199,7 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
WebTransformationMatrix rotationAboutZ;
rotationAboutZ.rotate3d(0, 0, 90);
-
+
child->setIsContainerForFixedPositionLayers(true);
child->setTransform(rotationAboutZ);
grandChild->setPosition(FloatPoint(8, 6));
@@ -1253,13 +1212,11 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
WebTransformationMatrix expectedChildTransform;
expectedChildTransform.multiply(rotationAboutZ);
- expectedChildTransform.translate(50, 50);
WebTransformationMatrix expectedGrandChildTransform;
expectedGrandChildTransform.multiply(rotationAboutZ); // child's local transform is inherited
expectedGrandChildTransform.translate(8, 6); // translation because of position occurs before layer's local transform.
expectedGrandChildTransform.multiply(rotationAboutZ); // grandChild's local transform
- expectedGrandChildTransform.translate(50, 50); // translation because of half-width half-height occurs after layer's local transform
WebTransformationMatrix expectedGreatGrandChildTransform = expectedGrandChildTransform;
@@ -1276,7 +1233,6 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
expectedChildTransform.makeIdentity();
expectedChildTransform.translate(-10, 0); // scrollDelta
expectedChildTransform.multiply(rotationAboutZ);
- expectedChildTransform.translate(50, 50);
expectedGrandChildTransform.makeIdentity();
expectedGrandChildTransform.translate(-10, 0); // child's scrollDelta is inherited
@@ -1284,7 +1240,6 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
expectedGrandChildTransform.translate(-5, 0); // grandChild's scrollDelta
expectedGrandChildTransform.translate(8, 6); // translation because of position occurs before layer's local transform.
expectedGrandChildTransform.multiply(rotationAboutZ); // grandChild's local transform
- expectedGrandChildTransform.translate(50, 50); // translation because of half-width half-height occurs after layer's local transform
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildTransform, child->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGrandChildTransform, grandChild->drawTransform());
@@ -1295,7 +1250,7 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
{
// This test checks for correct scroll compensation when the fixed-position container
// contributes to a different renderSurface than the fixed-position layer. In this
- // case, the surface originTransforms also have to be accounted for when checking the
+ // case, the surface drawTransforms also have to be accounted for when checking the
// scrollDelta.
DebugScopedSetImplThread scopedImplThread;
@@ -1313,30 +1268,27 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
WebTransformationMatrix rotationAboutZ;
rotationAboutZ.rotate3d(0, 0, 90);
grandChild->setTransform(rotationAboutZ);
-
+
// Case 1: scrollDelta of 0, 0
child->setScrollDelta(IntSize(0, 0));
executeCalculateDrawTransformsAndVisibility(root.get());
-
+
WebTransformationMatrix expectedChildTransform;
- expectedChildTransform.translate(50, 50);
- WebTransformationMatrix expectedSurfaceOriginTransform;
- expectedSurfaceOriginTransform.translate(8, 6);
- expectedSurfaceOriginTransform.multiply(rotationAboutZ);
+ WebTransformationMatrix expectedSurfaceDrawTransform;
+ expectedSurfaceDrawTransform.translate(8, 6);
+ expectedSurfaceDrawTransform.multiply(rotationAboutZ);
WebTransformationMatrix expectedGrandChildTransform;
- expectedGrandChildTransform.translate(50, 50);
WebTransformationMatrix expectedGreatGrandChildTransform;
- expectedGreatGrandChildTransform.translate(50, 50);
ASSERT_TRUE(grandChild->renderSurface());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildTransform, child->drawTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(expectedSurfaceOriginTransform, grandChild->renderSurface()->originTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedSurfaceDrawTransform, grandChild->renderSurface()->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGrandChildTransform, grandChild->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGreatGrandChildTransform, greatGrandChild->drawTransform());
// Case 2: scrollDelta of 10, 30
child->setScrollDelta(IntSize(10, 30));
executeCalculateDrawTransformsAndVisibility(root.get());
-
+
// Here the grandChild remains unchanged, because it scrolls along with the
// renderSurface, and the translation is actually in the renderSurface. But, the fixed
// position greatGrandChild is more awkward: its actually being drawn with respect to
@@ -1346,12 +1298,11 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
// transform explicitly contains the translation that cancels out the scroll.
expectedChildTransform.makeIdentity();
expectedChildTransform.translate(-10, -30); // scrollDelta
- expectedChildTransform.translate(50, 50);
- expectedSurfaceOriginTransform.makeIdentity();
- expectedSurfaceOriginTransform.translate(-10, -30); // scrollDelta
- expectedSurfaceOriginTransform.translate(8, 6);
- expectedSurfaceOriginTransform.multiply(rotationAboutZ);
+ expectedSurfaceDrawTransform.makeIdentity();
+ expectedSurfaceDrawTransform.translate(-10, -30); // scrollDelta
+ expectedSurfaceDrawTransform.translate(8, 6);
+ expectedSurfaceDrawTransform.multiply(rotationAboutZ);
// The rotation and its inverse are needed to place the scrollDelta compensation in
// the correct space. This test will fail if the rotation/inverse are backwards, too,
@@ -1360,11 +1311,10 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
expectedGreatGrandChildTransform.multiply(rotationAboutZ.inverse());
expectedGreatGrandChildTransform.translate(10, 30); // explicit canceling out the scrollDelta that gets embedded in the fixed position layer's surface.
expectedGreatGrandChildTransform.multiply(rotationAboutZ);
- expectedGreatGrandChildTransform.translate(50, 50);
ASSERT_TRUE(grandChild->renderSurface());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildTransform, child->drawTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(expectedSurfaceOriginTransform, grandChild->renderSurface()->originTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedSurfaceDrawTransform, grandChild->renderSurface()->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGrandChildTransform, grandChild->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGreatGrandChildTransform, greatGrandChild->drawTransform());
}
@@ -1416,31 +1366,27 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
executeCalculateDrawTransformsAndVisibility(root.get());
WebTransformationMatrix expectedChildTransform;
- expectedChildTransform.translate(50, 50);
- WebTransformationMatrix expectedGrandChildSurfaceOriginTransform;
- expectedGrandChildSurfaceOriginTransform.translate(8, 6);
- expectedGrandChildSurfaceOriginTransform.multiply(rotationAboutZ);
+ WebTransformationMatrix expectedGrandChildSurfaceDrawTransform;
+ expectedGrandChildSurfaceDrawTransform.translate(8, 6);
+ expectedGrandChildSurfaceDrawTransform.multiply(rotationAboutZ);
WebTransformationMatrix expectedGrandChildTransform;
- expectedGrandChildTransform.translate(50, 50);
- WebTransformationMatrix expectedGreatGrandChildSurfaceOriginTransform;
- expectedGreatGrandChildSurfaceOriginTransform.translate(40, 60);
- expectedGreatGrandChildSurfaceOriginTransform.multiply(rotationAboutZ);
+ WebTransformationMatrix expectedGreatGrandChildSurfaceDrawTransform;
+ expectedGreatGrandChildSurfaceDrawTransform.translate(40, 60);
+ expectedGreatGrandChildSurfaceDrawTransform.multiply(rotationAboutZ);
WebTransformationMatrix expectedGreatGrandChildTransform;
- expectedGreatGrandChildTransform.translate(50, 50);
WebTransformationMatrix expectedFixedPositionChildTransform;
- expectedFixedPositionChildTransform.translate(50, 50);
ASSERT_TRUE(grandChild->renderSurface());
ASSERT_TRUE(greatGrandChild->renderSurface());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildTransform, child->drawTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGrandChildSurfaceOriginTransform, grandChild->renderSurface()->originTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGrandChildSurfaceDrawTransform, grandChild->renderSurface()->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGrandChildTransform, grandChild->drawTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGreatGrandChildSurfaceOriginTransform, greatGrandChild->renderSurface()->originTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGreatGrandChildSurfaceDrawTransform, greatGrandChild->renderSurface()->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGreatGrandChildTransform, greatGrandChild->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedFixedPositionChildTransform, fixedPositionChild->drawTransform());
@@ -1450,12 +1396,11 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
expectedChildTransform.makeIdentity();
expectedChildTransform.translate(-10, -30); // scrollDelta
- expectedChildTransform.translate(50, 50);
- expectedGrandChildSurfaceOriginTransform.makeIdentity();
- expectedGrandChildSurfaceOriginTransform.translate(-10, -30); // scrollDelta
- expectedGrandChildSurfaceOriginTransform.translate(8, 6);
- expectedGrandChildSurfaceOriginTransform.multiply(rotationAboutZ);
+ expectedGrandChildSurfaceDrawTransform.makeIdentity();
+ expectedGrandChildSurfaceDrawTransform.translate(-10, -30); // scrollDelta
+ expectedGrandChildSurfaceDrawTransform.translate(8, 6);
+ expectedGrandChildSurfaceDrawTransform.multiply(rotationAboutZ);
// grandChild, greatGrandChild, and greatGrandChild's surface are not expected to
// change, since they are all not fixed, and they are all drawn with respect to
@@ -1463,25 +1408,24 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
// But the great-great grandchild, "fixedPositionChild", should have a transform that explicitly cancels out the scrollDelta.
// The expected transform is:
- // compoundOriginTransform.inverse() * translate(positive scrollDelta) * compoundOriginTransform * half-width-half-height translation
- WebTransformationMatrix compoundOriginTransform; // transform from greatGrandChildSurface's origin to the root surface.
- compoundOriginTransform.translate(8, 6); // origin translation of grandChild
- compoundOriginTransform.multiply(rotationAboutZ); // rotation of grandChild
- compoundOriginTransform.translate(40, 60); // origin translation of greatGrandChild
- compoundOriginTransform.multiply(rotationAboutZ); // rotation of greatGrandChild
+ // compoundDrawTransform.inverse() * translate(positive scrollDelta) * compoundOriginTransform
+ WebTransformationMatrix compoundDrawTransform; // transform from greatGrandChildSurface's origin to the root surface.
+ compoundDrawTransform.translate(8, 6); // origin translation of grandChild
+ compoundDrawTransform.multiply(rotationAboutZ); // rotation of grandChild
+ compoundDrawTransform.translate(40, 60); // origin translation of greatGrandChild
+ compoundDrawTransform.multiply(rotationAboutZ); // rotation of greatGrandChild
expectedFixedPositionChildTransform.makeIdentity();
- expectedFixedPositionChildTransform.multiply(compoundOriginTransform.inverse());
+ expectedFixedPositionChildTransform.multiply(compoundDrawTransform.inverse());
expectedFixedPositionChildTransform.translate(10, 30); // explicit canceling out the scrollDelta that gets embedded in the fixed position layer's surface.
- expectedFixedPositionChildTransform.multiply(compoundOriginTransform);
- expectedFixedPositionChildTransform.translate(50, 50);
+ expectedFixedPositionChildTransform.multiply(compoundDrawTransform);
ASSERT_TRUE(grandChild->renderSurface());
ASSERT_TRUE(greatGrandChild->renderSurface());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildTransform, child->drawTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGrandChildSurfaceOriginTransform, grandChild->renderSurface()->originTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGrandChildSurfaceDrawTransform, grandChild->renderSurface()->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGrandChildTransform, grandChild->drawTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGreatGrandChildSurfaceOriginTransform, greatGrandChild->renderSurface()->originTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGreatGrandChildSurfaceDrawTransform, greatGrandChild->renderSurface()->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGreatGrandChildTransform, greatGrandChild->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedFixedPositionChildTransform, fixedPositionChild->drawTransform());
}
@@ -1507,15 +1451,12 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
child->setScrollDelta(IntSize(0, 0));
executeCalculateDrawTransformsAndVisibility(root.get());
- // The expected draw transforms without any scroll should still include a translation to the center of the layer (i.e. translation by 50, 50).
- WebTransformationMatrix expectedSurfaceOriginTransform;
- expectedSurfaceOriginTransform.translate(0, 0);
+ WebTransformationMatrix expectedSurfaceDrawTransform;
+ expectedSurfaceDrawTransform.translate(0, 0);
WebTransformationMatrix expectedChildTransform;
- expectedChildTransform.translate(50, 50);
WebTransformationMatrix expectedGrandChildTransform;
- expectedGrandChildTransform.translate(50, 50);
ASSERT_TRUE(child->renderSurface());
- EXPECT_TRANSFORMATION_MATRIX_EQ(expectedSurfaceOriginTransform, child->renderSurface()->originTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedSurfaceDrawTransform, child->renderSurface()->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildTransform, child->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGrandChildTransform, grandChild->drawTransform());
@@ -1526,12 +1467,13 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWit
// The surface is translated by scrollDelta, the child transform doesn't change
// because it scrolls along with the surface, but the fixed position grandChild
// needs to compensate for the scroll translation.
- expectedSurfaceOriginTransform.makeIdentity();
- expectedSurfaceOriginTransform.translate(-10, -10);
+ expectedSurfaceDrawTransform.makeIdentity();
+ expectedSurfaceDrawTransform.translate(-10, -10);
expectedGrandChildTransform.makeIdentity();
- expectedGrandChildTransform.translate(60, 60);
+ expectedGrandChildTransform.translate(10, 10);
+
ASSERT_TRUE(child->renderSurface());
- EXPECT_TRANSFORMATION_MATRIX_EQ(expectedSurfaceOriginTransform, child->renderSurface()->originTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedSurfaceDrawTransform, child->renderSurface()->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildTransform, child->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGrandChildTransform, grandChild->drawTransform());
}
@@ -1557,11 +1499,8 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerTha
child->setScrollDelta(IntSize(0, 0));
executeCalculateDrawTransformsAndVisibility(root.get());
- // The expected draw transforms without any scroll should still include a translation to the center of the layer (i.e. translation by 50, 50).
WebTransformationMatrix expectedChildTransform;
- expectedChildTransform.translate(50, 50);
WebTransformationMatrix expectedGrandChildTransform;
- expectedGrandChildTransform.translate(50, 50);
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildTransform, child->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGrandChildTransform, grandChild->drawTransform());
@@ -1571,7 +1510,7 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerTha
// Here the child is affected by scrollDelta, but the fixed position grandChild should not be affected.
expectedChildTransform.makeIdentity();
- expectedChildTransform.translate(40, 40);
+ expectedChildTransform.translate(-10, -10);
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildTransform, child->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGrandChildTransform, grandChild->drawTransform());
}
@@ -1597,14 +1536,11 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerTha
root->setScrollDelta(IntSize(0, 0));
executeCalculateDrawTransformsAndVisibility(root.get());
- // The expected draw transforms without any scroll should still include a translation to the center of the layer (i.e. translation by 50, 50).
WebTransformationMatrix expectedChildTransform;
expectedChildTransform.multiply(rotationByZ);
- expectedChildTransform.translate(50, 50);
WebTransformationMatrix expectedGrandChildTransform;
expectedGrandChildTransform.multiply(rotationByZ);
- expectedGrandChildTransform.translate(50, 50);
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildTransform, child->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGrandChildTransform, grandChild->drawTransform());
@@ -1617,7 +1553,6 @@ TEST(CCLayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerTha
expectedChildTransform.makeIdentity();
expectedChildTransform.translate(-10, -10); // the scrollDelta
expectedChildTransform.multiply(rotationByZ);
- expectedChildTransform.translate(50, 50);
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildTransform, child->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGrandChildTransform, grandChild->drawTransform());
@@ -1646,7 +1581,6 @@ TEST(CCLayerTreeHostCommonTest, verifyClipRectCullsRenderSurfaces)
RefPtr<LayerChromium> greatGrandChild = LayerChromium::create();
RefPtr<LayerChromiumWithForcedDrawsContent> leafNode1 = adoptRef(new LayerChromiumWithForcedDrawsContent());
RefPtr<LayerChromiumWithForcedDrawsContent> leafNode2 = adoptRef(new LayerChromiumWithForcedDrawsContent());
- parent->createRenderSurface();
parent->addChild(child);
child->addChild(grandChild);
grandChild->addChild(greatGrandChild);
@@ -1664,21 +1598,13 @@ TEST(CCLayerTreeHostCommonTest, verifyClipRectCullsRenderSurfaces)
setLayerPropertiesForTesting(leafNode2.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(20, 20), false);
child->setMasksToBounds(true);
- child->setOpacity(0.4);
+ child->setOpacity(0.4f);
grandChild->setOpacity(0.5);
- greatGrandChild->setOpacity(0.4);
+ greatGrandChild->setOpacity(0.4f);
Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
- Vector<RefPtr<LayerChromium> > dummyLayerList;
int dummyMaxTextureSize = 512;
-
- // FIXME: when we fix this "root-layer special case" behavior in CCLayerTreeHost, we will have to fix it here, too.
- parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
- renderSurfaceLayerList.append(parent.get());
-
- CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
-
- FloatRect dummyDamageRect;
+ CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent->bounds(), 1, dummyMaxTextureSize, renderSurfaceLayerList);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, parent->renderSurface()->contentRect());
@@ -1720,18 +1646,12 @@ TEST(CCLayerTreeHostCommonTest, verifyClipRectCullsSurfaceWithoutVisibleContent)
setLayerPropertiesForTesting(leafNode.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(10, 10), false);
parent->setMasksToBounds(true);
- child->setOpacity(0.4);
- grandChild->setOpacity(0.4);
+ child->setOpacity(0.4f);
+ grandChild->setOpacity(0.4f);
Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
- Vector<RefPtr<LayerChromium> > dummyLayerList;
int dummyMaxTextureSize = 512;
-
- parent->createRenderSurface();
- parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
- renderSurfaceLayerList.append(parent.get());
-
- CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent->bounds(), 1, dummyMaxTextureSize, renderSurfaceLayerList);
// Without an animation, we should cull child and grandChild from the renderSurfaceLayerList.
ASSERT_EQ(1U, renderSurfaceLayerList.size());
@@ -1744,13 +1664,8 @@ TEST(CCLayerTreeHostCommonTest, verifyClipRectCullsSurfaceWithoutVisibleContent)
child->clearRenderSurface();
grandChild->clearRenderSurface();
renderSurfaceLayerList.clear();
- dummyLayerList.clear();
-
- parent->createRenderSurface();
- parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
- renderSurfaceLayerList.append(parent.get());
- CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent->bounds(), 1, dummyMaxTextureSize, renderSurfaceLayerList);
// With an animating transform, we should keep child and grandChild in the renderSurfaceLayerList.
ASSERT_EQ(3U, renderSurfaceLayerList.size());
@@ -1777,7 +1692,6 @@ TEST(CCLayerTreeHostCommonTest, verifyDrawableContentRectForLayers)
RefPtr<LayerChromium> grandChild3 = LayerChromium::create();
RefPtr<LayerChromium> grandChild4 = LayerChromium::create();
- parent->createRenderSurface();
parent->addChild(child);
child->addChild(grandChild1);
child->addChild(grandChild2);
@@ -1795,21 +1709,15 @@ TEST(CCLayerTreeHostCommonTest, verifyDrawableContentRectForLayers)
grandChild3->setMasksToBounds(true);
// Force everyone to be a render surface.
- child->setOpacity(0.4);
+ child->setOpacity(0.4f);
grandChild1->setOpacity(0.5);
grandChild2->setOpacity(0.5);
grandChild3->setOpacity(0.5);
grandChild4->setOpacity(0.5);
Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
- Vector<RefPtr<LayerChromium> > dummyLayerList;
int dummyMaxTextureSize = 512;
-
- // FIXME: when we fix this "root-layer special case" behavior in CCLayerTreeHost, we will have to fix it here, too.
- parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
- renderSurfaceLayerList.append(parent.get());
-
- CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent->bounds(), 1, dummyMaxTextureSize, renderSurfaceLayerList);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, parent->renderSurface()->contentRect());
@@ -1841,7 +1749,6 @@ TEST(CCLayerTreeHostCommonTest, verifyClipRectIsPropagatedCorrectlyToSurfaces)
RefPtr<LayerChromiumWithForcedDrawsContent> leafNode3 = adoptRef(new LayerChromiumWithForcedDrawsContent());
RefPtr<LayerChromiumWithForcedDrawsContent> leafNode4 = adoptRef(new LayerChromiumWithForcedDrawsContent());
- parent->createRenderSurface();
parent->addChild(child);
child->addChild(grandChild1);
child->addChild(grandChild2);
@@ -1870,21 +1777,15 @@ TEST(CCLayerTreeHostCommonTest, verifyClipRectIsPropagatedCorrectlyToSurfaces)
grandChild4->setMasksToBounds(true);
// Force everyone to be a render surface.
- child->setOpacity(0.4);
+ child->setOpacity(0.4f);
grandChild1->setOpacity(0.5);
grandChild2->setOpacity(0.5);
grandChild3->setOpacity(0.5);
grandChild4->setOpacity(0.5);
Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
- Vector<RefPtr<LayerChromium> > dummyLayerList;
int dummyMaxTextureSize = 512;
-
- // FIXME: when we fix this "root-layer special case" behavior in CCLayerTreeHost, we will have to fix it here, too.
- parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
- renderSurfaceLayerList.append(parent.get());
-
- CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent->bounds(), 1, dummyMaxTextureSize, renderSurfaceLayerList);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, parent->renderSurface()->contentRect());
@@ -1910,7 +1811,6 @@ TEST(CCLayerTreeHostCommonTest, verifyAnimationsForRenderSurfaceHierarchy)
RefPtr<LayerChromium> grandChildOfRoot = LayerChromium::create();
RefPtr<LayerChromiumWithForcedDrawsContent> grandChildOfRS1 = adoptRef(new LayerChromiumWithForcedDrawsContent());
RefPtr<LayerChromiumWithForcedDrawsContent> grandChildOfRS2 = adoptRef(new LayerChromiumWithForcedDrawsContent());
- parent->createRenderSurface();
parent->addChild(renderSurface1);
parent->addChild(childOfRoot);
renderSurface1->addChild(childOfRS1);
@@ -2316,7 +2216,6 @@ TEST(CCLayerTreeHostCommonTest, verifyBackFaceCullingWithoutPreserves3d)
RefPtr<LayerChromiumWithForcedDrawsContent> frontFacingChildOfBackFacingSurface = adoptRef(new LayerChromiumWithForcedDrawsContent());
RefPtr<LayerChromiumWithForcedDrawsContent> backFacingChildOfBackFacingSurface = adoptRef(new LayerChromiumWithForcedDrawsContent());
- parent->createRenderSurface();
parent->addChild(frontFacingChild);
parent->addChild(backFacingChild);
parent->addChild(frontFacingSurface);
@@ -2358,12 +2257,8 @@ TEST(CCLayerTreeHostCommonTest, verifyBackFaceCullingWithoutPreserves3d)
setLayerPropertiesForTesting(backFacingChildOfBackFacingSurface.get(), backfaceMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
- Vector<RefPtr<LayerChromium> > dummyLayerList;
int dummyMaxTextureSize = 512;
- parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
- renderSurfaceLayerList.append(parent.get());
-
- CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent->bounds(), 1, dummyMaxTextureSize, renderSurfaceLayerList);
// Verify which renderSurfaces were created.
EXPECT_FALSE(frontFacingChild->renderSurface());
@@ -2415,7 +2310,6 @@ TEST(CCLayerTreeHostCommonTest, verifyBackFaceCullingWithPreserves3d)
RefPtr<LayerChromiumWithForcedDrawsContent> dummyReplicaLayer1 = adoptRef(new LayerChromiumWithForcedDrawsContent());
RefPtr<LayerChromiumWithForcedDrawsContent> dummyReplicaLayer2 = adoptRef(new LayerChromiumWithForcedDrawsContent());
- parent->createRenderSurface();
parent->addChild(frontFacingChild);
parent->addChild(backFacingChild);
parent->addChild(frontFacingSurface);
@@ -2462,12 +2356,8 @@ TEST(CCLayerTreeHostCommonTest, verifyBackFaceCullingWithPreserves3d)
setLayerPropertiesForTesting(backFacingChildOfBackFacingSurface.get(), backfaceMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
- Vector<RefPtr<LayerChromium> > dummyLayerList;
int dummyMaxTextureSize = 512;
- parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
- renderSurfaceLayerList.append(parent.get());
-
- CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent->bounds(), 1, dummyMaxTextureSize, renderSurfaceLayerList);
// Verify which renderSurfaces were created.
EXPECT_FALSE(frontFacingChild->renderSurface());
@@ -2512,7 +2402,6 @@ TEST(CCLayerTreeHostCommonTest, verifyBackFaceCullingWithAnimatingTransforms)
RefPtr<LayerChromiumWithForcedDrawsContent> animatingChild = adoptRef(new LayerChromiumWithForcedDrawsContent());
RefPtr<LayerChromiumWithForcedDrawsContent> child2 = adoptRef(new LayerChromiumWithForcedDrawsContent());
- parent->createRenderSurface();
parent->addChild(child);
parent->addChild(animatingSurface);
animatingSurface->addChild(childOfAnimatingSurface);
@@ -2547,13 +2436,8 @@ TEST(CCLayerTreeHostCommonTest, verifyBackFaceCullingWithAnimatingTransforms)
setLayerPropertiesForTesting(child2.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
- Vector<RefPtr<LayerChromium> > dummyLayerList;
int dummyMaxTextureSize = 512;
-
- parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
- renderSurfaceLayerList.append(parent.get());
-
- CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent->bounds(), 1, dummyMaxTextureSize, renderSurfaceLayerList);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, parent->renderSurface()->contentRect());
@@ -2599,7 +2483,6 @@ TEST(CCLayerTreeHostCommonTest, verifyBackFaceCullingWithPreserves3dForFlattenin
RefPtr<LayerChromiumWithForcedDrawsContent> child1 = adoptRef(new LayerChromiumWithForcedDrawsContent());
RefPtr<LayerChromiumWithForcedDrawsContent> child2 = adoptRef(new LayerChromiumWithForcedDrawsContent());
- parent->createRenderSurface();
parent->addChild(frontFacingSurface);
parent->addChild(backFacingSurface);
frontFacingSurface->addChild(child1);
@@ -2621,12 +2504,8 @@ TEST(CCLayerTreeHostCommonTest, verifyBackFaceCullingWithPreserves3dForFlattenin
setLayerPropertiesForTesting(child2.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), false);
Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
- Vector<RefPtr<LayerChromium> > dummyLayerList;
int dummyMaxTextureSize = 512;
- parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
- renderSurfaceLayerList.append(parent.get());
-
- CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent->bounds(), 1, dummyMaxTextureSize, renderSurfaceLayerList);
// Verify which renderSurfaces were created.
EXPECT_TRUE(frontFacingSurface->renderSurface());
@@ -2670,8 +2549,6 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForSingleLayer)
DebugScopedSetImplThread thisScopeIsOnImplThread;
OwnPtr<CCLayerImpl> root = CCLayerImpl::create(12345);
- root->createRenderSurface();
- root->renderSurface()->setContentRect(IntRect(IntPoint::zero(), IntSize(100, 100)));
WebTransformationMatrix identityMatrix;
FloatPoint anchor(0, 0);
@@ -2681,10 +2558,8 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForSingleLayer)
root->setDrawsContent(true);
Vector<CCLayerImpl*> renderSurfaceLayerList;
- Vector<CCLayerImpl*> dummyLayerList;
int dummyMaxTextureSize = 512;
- renderSurfaceLayerList.append(root.get());
- CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, 0, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root->bounds(), 1, 0, dummyMaxTextureSize, renderSurfaceLayerList);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, FloatRect()); // empty scissorRect will help ensure we're hit testing the correct rect.
// Sanity check the scenario we just created.
@@ -2717,8 +2592,6 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForUninvertibleTransform)
DebugScopedSetImplThread thisScopeIsOnImplThread;
OwnPtr<CCLayerImpl> root = CCLayerImpl::create(12345);
- root->createRenderSurface();
- root->renderSurface()->setContentRect(IntRect(IntPoint::zero(), IntSize(100, 100)));
WebTransformationMatrix uninvertibleTransform;
uninvertibleTransform.setM11(0);
@@ -2735,10 +2608,8 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForUninvertibleTransform)
root->setDrawsContent(true);
Vector<CCLayerImpl*> renderSurfaceLayerList;
- Vector<CCLayerImpl*> dummyLayerList;
int dummyMaxTextureSize = 512;
- renderSurfaceLayerList.append(root.get());
- CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, 0, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root->bounds(), 1, 0, dummyMaxTextureSize, renderSurfaceLayerList);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, FloatRect()); // empty scissorRect will help ensure we're hit testing the correct rect.
// Sanity check the scenario we just created.
@@ -2783,8 +2654,6 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForSinglePositionedLayer)
DebugScopedSetImplThread thisScopeIsOnImplThread;
OwnPtr<CCLayerImpl> root = CCLayerImpl::create(12345);
- root->createRenderSurface();
- root->renderSurface()->setContentRect(IntRect(IntPoint::zero(), IntSize(100, 100)));
WebTransformationMatrix identityMatrix;
FloatPoint anchor(0, 0);
@@ -2794,10 +2663,8 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForSinglePositionedLayer)
root->setDrawsContent(true);
Vector<CCLayerImpl*> renderSurfaceLayerList;
- Vector<CCLayerImpl*> dummyLayerList;
int dummyMaxTextureSize = 512;
- renderSurfaceLayerList.append(root.get());
- CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, 0, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root->bounds(), 1, 0, dummyMaxTextureSize, renderSurfaceLayerList);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, FloatRect()); // empty scissorRect will help ensure we're hit testing the correct rect.
// Sanity check the scenario we just created.
@@ -2831,8 +2698,6 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForSingleRotatedLayer)
DebugScopedSetImplThread thisScopeIsOnImplThread;
OwnPtr<CCLayerImpl> root = CCLayerImpl::create(12345);
- root->createRenderSurface();
- root->renderSurface()->setContentRect(IntRect(IntPoint::zero(), IntSize(100, 100)));
WebTransformationMatrix identityMatrix;
WebTransformationMatrix rotation45DegreesAboutCenter;
@@ -2846,10 +2711,8 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForSingleRotatedLayer)
root->setDrawsContent(true);
Vector<CCLayerImpl*> renderSurfaceLayerList;
- Vector<CCLayerImpl*> dummyLayerList;
int dummyMaxTextureSize = 512;
- renderSurfaceLayerList.append(root.get());
- CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, 0, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root->bounds(), 1, 0, dummyMaxTextureSize, renderSurfaceLayerList);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, FloatRect()); // empty scissorRect will help ensure we're hit testing the correct rect.
// Sanity check the scenario we just created.
@@ -2887,8 +2750,6 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForSinglePerspectiveLayer)
DebugScopedSetImplThread thisScopeIsOnImplThread;
OwnPtr<CCLayerImpl> root = CCLayerImpl::create(12345);
- root->createRenderSurface();
- root->renderSurface()->setContentRect(IntRect(IntPoint::zero(), IntSize(100, 100)));
WebTransformationMatrix identityMatrix;
@@ -2907,10 +2768,8 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForSinglePerspectiveLayer)
root->setDrawsContent(true);
Vector<CCLayerImpl*> renderSurfaceLayerList;
- Vector<CCLayerImpl*> dummyLayerList;
int dummyMaxTextureSize = 512;
- renderSurfaceLayerList.append(root.get());
- CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, 0, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root->bounds(), 1, 0, dummyMaxTextureSize, renderSurfaceLayerList);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, FloatRect()); // empty scissorRect will help ensure we're hit testing the correct rect.
// Sanity check the scenario we just created.
@@ -2945,8 +2804,7 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForSingleLayerWithScaledContents
// screenSpaceTransform converts from the layer's origin space to screen space. This
// test makes sure that hit testing works correctly accounts for the contents scale.
// A contentsScale that is not 1 effectively forces a non-identity transform between
- // layer's content space and layer's origin space, which is not included in the
- // screenSpaceTransform. The hit testing code must take this into account.
+ // layer's content space and layer's origin space. The hit testing code must take this into account.
//
// To test this, the layer is positioned at (25, 25), and is size (50, 50). If
// contentsScale is ignored, then hit testing will mis-interpret the visibleContentRect
@@ -2954,44 +2812,52 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForSingleLayerWithScaledContents
//
DebugScopedSetImplThread thisScopeIsOnImplThread;
- OwnPtr<CCLayerImpl> root = CCLayerImpl::create(12345);
- root->createRenderSurface();
- root->renderSurface()->setContentRect(IntRect(IntPoint::zero(), IntSize(100, 100)));
+ OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
WebTransformationMatrix identityMatrix;
FloatPoint anchor(0, 0);
- FloatPoint position(25, 25);
- IntSize bounds(50, 50);
- setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
- root->setDrawsContent(true);
- root->setContentBounds(IntSize(100, 100));
+ setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, anchor, FloatPoint(0, 0), IntSize(100, 100), false);
+
+ {
+ FloatPoint position(25, 25);
+ IntSize bounds(50, 50);
+ OwnPtr<CCLayerImpl> testLayer = CCLayerImpl::create(12345);
+ setLayerPropertiesForTesting(testLayer.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
+
+ // override contentBounds
+ testLayer->setContentBounds(IntSize(100, 100));
+
+ testLayer->setDrawsContent(true);
+ root->addChild(testLayer.release());
+ }
Vector<CCLayerImpl*> renderSurfaceLayerList;
- Vector<CCLayerImpl*> dummyLayerList;
int dummyMaxTextureSize = 512;
- renderSurfaceLayerList.append(root.get());
- CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, 0, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root->bounds(), 1, 0, dummyMaxTextureSize, renderSurfaceLayerList);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, FloatRect()); // empty scissorRect will help ensure we're hit testing the correct rect.
// Sanity check the scenario we just created.
- // The visibleContentRect is actually 100x100, even though the layout size of the layer is 50x50, positioned at 25x25.
- EXPECT_INT_RECT_EQ(IntRect(IntPoint::zero(), IntSize(100, 100)), root->visibleContentRect());
+ // The visibleContentRect for testLayer is actually 100x100, even though its layout size is 50x50, positioned at 25x25.
+ CCLayerImpl* testLayer = root->children()[0].get();
+ EXPECT_INT_RECT_EQ(IntRect(IntPoint::zero(), IntSize(100, 100)), testLayer->visibleContentRect());
ASSERT_EQ(1u, renderSurfaceLayerList.size());
ASSERT_EQ(1u, root->renderSurface()->layerList().size());
- // Hit testing for a point outside the layer should return a null pointer.
- IntPoint testPoint(24, 24);
+ // Hit testing for a point outside the layer should return a null pointer (the root layer does not draw content, so it will not be hit tested either).
+ IntPoint testPoint(101, 101);
CCLayerImpl* resultLayer = CCLayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
EXPECT_FALSE(resultLayer);
- // Even though the layer exists at (101, 101), it should not be visible there since the root renderSurface would clamp it.
- // This case in particular is likely to fail if contents scale is not correctly accounted for.
+ testPoint = IntPoint(24, 24);
+ resultLayer = CCLayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
+ EXPECT_FALSE(resultLayer);
+
testPoint = IntPoint(76, 76);
resultLayer = CCLayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
EXPECT_FALSE(resultLayer);
- // Hit testing for a point inside should return the root layer.
+ // Hit testing for a point inside should return the test layer.
testPoint = IntPoint(26, 26);
resultLayer = CCLayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
ASSERT_TRUE(resultLayer);
@@ -3009,36 +2875,37 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForSimpleClippedLayer)
// the entire layer bounds. Here we just test the simple axis-aligned case.
DebugScopedSetImplThread thisScopeIsOnImplThread;
- OwnPtr<CCLayerImpl> root = CCLayerImpl::create(123);
- root->createRenderSurface();
- root->renderSurface()->setContentRect(IntRect(IntPoint::zero(), IntSize(100, 100)));
-
WebTransformationMatrix identityMatrix;
FloatPoint anchor(0, 0);
- FloatPoint position(25, 25); // this layer is positioned, and hit testing should correctly know where the layer is located.
- IntSize bounds(50, 50);
- setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
- root->setMasksToBounds(true);
+
+ OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
+ setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, anchor, FloatPoint(0, 0), IntSize(100, 100), false);
{
+ OwnPtr<CCLayerImpl> clippingLayer = CCLayerImpl::create(123);
+ FloatPoint position(25, 25); // this layer is positioned, and hit testing should correctly know where the layer is located.
+ IntSize bounds(50, 50);
+ setLayerPropertiesForTesting(clippingLayer.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
+ clippingLayer->setMasksToBounds(true);
+
OwnPtr<CCLayerImpl> child = CCLayerImpl::create(456);
position = FloatPoint(-50, -50);
bounds = IntSize(300, 300);
setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
child->setDrawsContent(true);
- root->addChild(child.release());
+ clippingLayer->addChild(child.release());
+ root->addChild(clippingLayer.release());
}
Vector<CCLayerImpl*> renderSurfaceLayerList;
- Vector<CCLayerImpl*> dummyLayerList;
int dummyMaxTextureSize = 512;
- renderSurfaceLayerList.append(root.get());
- CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, 0, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root->bounds(), 1, 0, dummyMaxTextureSize, renderSurfaceLayerList);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, FloatRect()); // empty scissorRect will help ensure we're hit testing the correct rect.
// Sanity check the scenario we just created.
ASSERT_EQ(1u, renderSurfaceLayerList.size());
ASSERT_EQ(1u, root->renderSurface()->layerList().size());
+ ASSERT_EQ(456, root->renderSurface()->layerList()[0]->id());
// Hit testing for a point outside the layer should return a null pointer.
// Despite the child layer being very large, it should be clipped to the root layer's bounds.
@@ -3046,7 +2913,7 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForSimpleClippedLayer)
CCLayerImpl* resultLayer = CCLayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
EXPECT_FALSE(resultLayer);
- // Even though the layer exists at (101, 101), it should not be visible there since the root renderSurface would clamp it.
+ // Even though the layer exists at (101, 101), it should not be visible there since the clippingLayer would clamp it.
testPoint = IntPoint(76, 76);
resultLayer = CCLayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList);
EXPECT_FALSE(resultLayer);
@@ -3078,8 +2945,6 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForMultiClippedRotatedLayer)
DebugScopedSetImplThread thisScopeIsOnImplThread;
OwnPtr<CCLayerImpl> root = CCLayerImpl::create(123);
- root->createRenderSurface();
- root->renderSurface()->setContentRect(IntRect(IntPoint::zero(), IntSize(100, 100)));
WebTransformationMatrix identityMatrix;
FloatPoint anchor(0, 0);
@@ -3124,10 +2989,8 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForMultiClippedRotatedLayer)
}
Vector<CCLayerImpl*> renderSurfaceLayerList;
- Vector<CCLayerImpl*> dummyLayerList;
int dummyMaxTextureSize = 512;
- renderSurfaceLayerList.append(root.get());
- CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, 0, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root->bounds(), 1, 0, dummyMaxTextureSize, renderSurfaceLayerList);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, FloatRect()); // empty scissorRect will help ensure we're hit testing the correct rect.
// Sanity check the scenario we just created.
@@ -3181,8 +3044,6 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForMultipleLayers)
DebugScopedSetImplThread thisScopeIsOnImplThread;
OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
- root->createRenderSurface();
- root->renderSurface()->setContentRect(IntRect(IntPoint::zero(), IntSize(100, 100)));
WebTransformationMatrix identityMatrix;
FloatPoint anchor(0, 0);
@@ -3228,10 +3089,8 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForMultipleLayers)
CCLayerImpl* grandChild1 = child1->children()[0].get();
Vector<CCLayerImpl*> renderSurfaceLayerList;
- Vector<CCLayerImpl*> dummyLayerList;
int dummyMaxTextureSize = 512;
- renderSurfaceLayerList.append(root.get());
- CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, 0, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root->bounds(), 1, 0, dummyMaxTextureSize, renderSurfaceLayerList);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, FloatRect()); // empty scissorRect will help ensure we're hit testing the correct rect.
// Sanity check the scenario we just created.
@@ -3291,8 +3150,6 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForMultipleLayerLists)
DebugScopedSetImplThread thisScopeIsOnImplThread;
OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1);
- root->createRenderSurface();
- root->renderSurface()->setContentRect(IntRect(IntPoint::zero(), IntSize(100, 100)));
WebTransformationMatrix identityMatrix;
FloatPoint anchor(0, 0);
@@ -3341,10 +3198,8 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForMultipleLayerLists)
CCLayerImpl* grandChild1 = child1->children()[0].get();
Vector<CCLayerImpl*> renderSurfaceLayerList;
- Vector<CCLayerImpl*> dummyLayerList;
int dummyMaxTextureSize = 512;
- renderSurfaceLayerList.append(root.get());
- CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root.get(), identityMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, 0, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root->bounds(), 1, 0, dummyMaxTextureSize, renderSurfaceLayerList);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, FloatRect()); // empty scissorRect will help ensure we're hit testing the correct rect.
// Sanity check the scenario we just created.
@@ -3420,7 +3275,6 @@ TEST(CCLayerTreeHostCommonTest, verifyLayerTransformsInHighDPI)
// Verify draw and screen space transforms of layers not in a surface.
MockContentLayerDelegate delegate;
WebTransformationMatrix identityMatrix;
- WebTransformationMatrix parentMatrix;
RefPtr<ContentLayerChromium> parent = createDrawableContentLayerChromium(&delegate);
setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(100, 100), true);
@@ -3435,40 +3289,27 @@ TEST(CCLayerTreeHostCommonTest, verifyLayerTransformsInHighDPI)
parent->addChild(childNoScale);
Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
- Vector<RefPtr<LayerChromium> > dummyLayerList;
int dummyMaxTextureSize = 512;
- parent->createRenderSurface();
- parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
- renderSurfaceLayerList.append(parent.get());
-
const double deviceScaleFactor = 2.5;
- parentMatrix.scale(deviceScaleFactor);
parent->setContentsScale(deviceScaleFactor);
child->setContentsScale(deviceScaleFactor);
EXPECT_EQ(childNoScale->contentsScale(), 1);
- CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), parentMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent->bounds(), deviceScaleFactor, dummyMaxTextureSize, renderSurfaceLayerList);
EXPECT_EQ(1u, renderSurfaceLayerList.size());
// Verify parent transforms
- WebTransformationMatrix expectedParentScreenSpaceTransform;
- expectedParentScreenSpaceTransform.setM11(deviceScaleFactor);
- expectedParentScreenSpaceTransform.setM22(deviceScaleFactor);
- EXPECT_TRANSFORMATION_MATRIX_EQ(expectedParentScreenSpaceTransform, parent->screenSpaceTransform());
-
- WebTransformationMatrix expectedParentDrawTransform = expectedParentScreenSpaceTransform;
- expectedParentDrawTransform.translate(0.5 * parent->bounds().width(), 0.5 * parent->bounds().height());
- EXPECT_TRANSFORMATION_MATRIX_EQ(expectedParentDrawTransform, parent->drawTransform());
+ WebTransformationMatrix expectedParentTransform;
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedParentTransform, parent->screenSpaceTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedParentTransform, parent->drawTransform());
// Verify results of transformed parent rects
- IntRect parentBounds(IntPoint(), parent->bounds());
- IntRect centeredParentBounds = parentBounds;
- centeredParentBounds.move(-parentBounds.width() * 0.5, -parentBounds.height() * 0.5);
+ FloatRect parentContentBounds(FloatPoint(), FloatSize(parent->contentBounds()));
- FloatRect parentDrawRect = CCMathUtil::mapClippedRect(parent->drawTransform(), FloatRect(centeredParentBounds));
- FloatRect parentScreenSpaceRect = CCMathUtil::mapClippedRect(parent->screenSpaceTransform(), FloatRect(parentBounds));
+ FloatRect parentDrawRect = CCMathUtil::mapClippedRect(parent->drawTransform(), parentContentBounds);
+ FloatRect parentScreenSpaceRect = CCMathUtil::mapClippedRect(parent->screenSpaceTransform(), parentContentBounds);
FloatRect expectedParentDrawRect(FloatPoint(), parent->bounds());
expectedParentDrawRect.scale(deviceScaleFactor);
@@ -3476,23 +3317,16 @@ TEST(CCLayerTreeHostCommonTest, verifyLayerTransformsInHighDPI)
EXPECT_FLOAT_RECT_EQ(expectedParentDrawRect, parentScreenSpaceRect);
// Verify child transforms
- WebTransformationMatrix expectedChildScreenSpaceTransform;
- expectedChildScreenSpaceTransform.setM11(deviceScaleFactor);
- expectedChildScreenSpaceTransform.setM22(deviceScaleFactor);
- expectedChildScreenSpaceTransform.translate(child->position().x(), child->position().y());
- EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildScreenSpaceTransform, child->screenSpaceTransform());
-
- WebTransformationMatrix expectedChildDrawTransform = expectedChildScreenSpaceTransform;
- expectedChildDrawTransform.translate(0.5 * child->bounds().width(), 0.5 * child->bounds().height());
- EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildDrawTransform, child->drawTransform());
+ WebTransformationMatrix expectedChildTransform;
+ expectedChildTransform.translate(deviceScaleFactor * child->position().x(), deviceScaleFactor * child->position().y());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildTransform, child->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildTransform, child->screenSpaceTransform());
// Verify results of transformed child rects
- IntRect childBounds(IntPoint(), child->bounds());
- IntRect centeredChildBounds = childBounds;
- centeredChildBounds.move(-childBounds.width() * 0.5, -childBounds.height() * 0.5);
+ FloatRect childContentBounds(FloatPoint(), FloatSize(child->contentBounds()));
- FloatRect childDrawRect = CCMathUtil::mapClippedRect(child->drawTransform(), FloatRect(centeredChildBounds));
- FloatRect childScreenSpaceRect = CCMathUtil::mapClippedRect(child->screenSpaceTransform(), FloatRect(childBounds));
+ FloatRect childDrawRect = CCMathUtil::mapClippedRect(child->drawTransform(), childContentBounds);
+ FloatRect childScreenSpaceRect = CCMathUtil::mapClippedRect(child->screenSpaceTransform(), childContentBounds);
FloatRect expectedChildDrawRect(FloatPoint(), child->bounds());
expectedChildDrawRect.move(child->position().x(), child->position().y());
@@ -3501,15 +3335,18 @@ TEST(CCLayerTreeHostCommonTest, verifyLayerTransformsInHighDPI)
EXPECT_FLOAT_RECT_EQ(expectedChildDrawRect, childScreenSpaceRect);
// Verify childNoScale transforms
- EXPECT_TRANSFORMATION_MATRIX_EQ(child->drawTransform(), childNoScale->drawTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(child->screenSpaceTransform(), childNoScale->screenSpaceTransform());
+ WebTransformationMatrix expectedChildNoScaleTransform = child->drawTransform();
+ // All transforms operate on content rects. The child's content rect
+ // incorporates device scale, but the childNoScale does not; add it here.
+ expectedChildNoScaleTransform.scale(deviceScaleFactor);
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildNoScaleTransform, childNoScale->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedChildNoScaleTransform, childNoScale->screenSpaceTransform());
}
TEST(CCLayerTreeHostCommonTest, verifyRenderSurfaceTransformsInHighDPI)
{
MockContentLayerDelegate delegate;
WebTransformationMatrix identityMatrix;
- WebTransformationMatrix parentMatrix;
RefPtr<ContentLayerChromium> parent = createDrawableContentLayerChromium(&delegate);
setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(30, 30), true);
@@ -3532,59 +3369,44 @@ TEST(CCLayerTreeHostCommonTest, verifyRenderSurfaceTransformsInHighDPI)
child->setReplicaLayer(replica.get());
Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
- Vector<RefPtr<LayerChromium> > dummyLayerList;
int dummyMaxTextureSize = 512;
- parent->createRenderSurface();
- parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds()));
- renderSurfaceLayerList.append(parent.get());
-
const double deviceScaleFactor = 1.5;
- parentMatrix.scale(deviceScaleFactor);
parent->setContentsScale(deviceScaleFactor);
child->setContentsScale(deviceScaleFactor);
duplicateChildNonOwner->setContentsScale(deviceScaleFactor);
replica->setContentsScale(deviceScaleFactor);
- CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), parentMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent->bounds(), deviceScaleFactor, dummyMaxTextureSize, renderSurfaceLayerList);
// We should have two render surfaces. The root's render surface and child's
// render surface (it needs one because it has a replica layer).
EXPECT_EQ(2u, renderSurfaceLayerList.size());
- WebTransformationMatrix expectedParentScreenSpaceTransform;
- expectedParentScreenSpaceTransform.setM11(deviceScaleFactor);
- expectedParentScreenSpaceTransform.setM22(deviceScaleFactor);
- WebTransformationMatrix expectedParentDrawTransform = expectedParentScreenSpaceTransform;
- expectedParentDrawTransform.translate(0.5 * parent->bounds().width(), 0.5 * parent->bounds().height());
- EXPECT_TRANSFORMATION_MATRIX_EQ(expectedParentDrawTransform, parent->drawTransform());
- EXPECT_TRANSFORMATION_MATRIX_EQ(expectedParentScreenSpaceTransform, parent->screenSpaceTransform());
+ WebTransformationMatrix expectedParentTransform;
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedParentTransform, parent->screenSpaceTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedParentTransform, parent->drawTransform());
WebTransformationMatrix expectedDrawTransform;
- expectedDrawTransform.setM11(deviceScaleFactor);
- expectedDrawTransform.setM22(deviceScaleFactor);
- expectedDrawTransform.setM41(0.5 * deviceScaleFactor * child->bounds().width());
- expectedDrawTransform.setM42(0.5 * deviceScaleFactor * child->bounds().height());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedDrawTransform, child->drawTransform());
WebTransformationMatrix expectedScreenSpaceTransform;
- expectedScreenSpaceTransform.setM11(deviceScaleFactor);
- expectedScreenSpaceTransform.setM22(deviceScaleFactor);
- expectedScreenSpaceTransform.translate(child->position().x(), child->position().y());
+ expectedScreenSpaceTransform.translate(deviceScaleFactor * child->position().x(), deviceScaleFactor * child->position().y());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedScreenSpaceTransform, child->screenSpaceTransform());
+ WebTransformationMatrix expectedDuplicateChildDrawTransform = child->drawTransform();
EXPECT_TRANSFORMATION_MATRIX_EQ(child->drawTransform(), duplicateChildNonOwner->drawTransform());
EXPECT_TRANSFORMATION_MATRIX_EQ(child->screenSpaceTransform(), duplicateChildNonOwner->screenSpaceTransform());
EXPECT_INT_RECT_EQ(child->drawableContentRect(), duplicateChildNonOwner->drawableContentRect());
EXPECT_EQ(child->contentBounds(), duplicateChildNonOwner->contentBounds());
WebTransformationMatrix expectedRenderSurfaceDrawTransform;
- expectedRenderSurfaceDrawTransform.translate(deviceScaleFactor * (child->position().x() + 0.5 * child->bounds().width()), deviceScaleFactor * (child->position().y() + 0.5 * child->bounds().height()));
+ expectedRenderSurfaceDrawTransform.translate(deviceScaleFactor * child->position().x(), deviceScaleFactor * child->position().y());
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedRenderSurfaceDrawTransform, child->renderSurface()->drawTransform());
- WebTransformationMatrix expectedOriginTransform;
- expectedOriginTransform.translate(deviceScaleFactor * 2, deviceScaleFactor * 2);
- EXPECT_TRANSFORMATION_MATRIX_EQ(expectedOriginTransform, child->renderSurface()->originTransform());
+ WebTransformationMatrix expectedSurfaceDrawTransform;
+ expectedSurfaceDrawTransform.translate(deviceScaleFactor * 2, deviceScaleFactor * 2);
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expectedSurfaceDrawTransform, child->renderSurface()->drawTransform());
WebTransformationMatrix expectedSurfaceScreenSpaceTransform;
expectedSurfaceScreenSpaceTransform.translate(deviceScaleFactor * 2, deviceScaleFactor * 2);
@@ -3592,15 +3414,10 @@ TEST(CCLayerTreeHostCommonTest, verifyRenderSurfaceTransformsInHighDPI)
WebTransformationMatrix expectedReplicaDrawTransform;
expectedReplicaDrawTransform.setM22(-1);
- expectedReplicaDrawTransform.setM41(13.5);
- expectedReplicaDrawTransform.setM42(-1.5);
+ expectedReplicaDrawTransform.setM41(6);
+ expectedReplicaDrawTransform.setM42(6);
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedReplicaDrawTransform, child->renderSurface()->replicaDrawTransform());
- WebTransformationMatrix expectedReplicaOriginTransform = expectedReplicaDrawTransform;
- expectedReplicaOriginTransform.setM41(6);
- expectedReplicaOriginTransform.setM42(6);
- EXPECT_TRANSFORMATION_MATRIX_EQ(expectedReplicaOriginTransform, child->renderSurface()->replicaOriginTransform());
-
WebTransformationMatrix expectedReplicaScreenSpaceTransform;
expectedReplicaScreenSpaceTransform.setM22(-1);
expectedReplicaScreenSpaceTransform.setM41(6);
@@ -3630,17 +3447,4 @@ TEST(CCLayerTreeHostCommonTest, verifySubtreeSearch)
EXPECT_EQ(0, CCLayerTreeHostCommon::findLayerInSubtree(root.get(), nonexistentId));
}
-// FIXME:
-// continue working on https://bugs.webkit.org/show_bug.cgi?id=68942
-// - add a test to verify clipping that changes the "center point"
-// - add a case that checks if a render surface's drawTransform is computed correctly. For the general case, and for special cases when clipping.
-// - add a case that checks if a render surface's replicaTransform is computed correctly.
-// - test all the conditions under which render surfaces are created
-// - if possible, test all conditions under which render surfaces are not created
-// - verify that the layer lists of render surfaces are correct, verify that renderTarget's RenderSurface values for each layer are correct.
-// - test the computation of clip rects and content rects
-// - test the special cases for mask layers and replica layers
-// - test the other functions in CCLayerTreeHostCommon
-//
-
} // namespace
diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
index 1419164b5..53c312cf5 100644
--- a/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
@@ -1038,12 +1038,12 @@ TEST_F(CCLayerTreeHostImplTest, pageScaleDeltaAppliedToRootScrollLayerOnly)
m_hostImpl->drawLayers(frame);
m_hostImpl->didDrawAllLayers(frame);
- WebTransformationMatrix pageScaleTransform;
- pageScaleTransform.scale(newPageScale);
- pageScaleTransform.translate(0.5 * surfaceSize.width(), 0.5 * surfaceSize.height());
- EXPECT_EQ(root->drawTransform(), pageScaleTransform);
- EXPECT_EQ(child->drawTransform(), pageScaleTransform);
- EXPECT_EQ(grandChild->drawTransform(), pageScaleTransform);
+ EXPECT_EQ(root->drawTransform().m11(), newPageScale);
+ EXPECT_EQ(root->drawTransform().m22(), newPageScale);
+ EXPECT_EQ(child->drawTransform().m11(), newPageScale);
+ EXPECT_EQ(child->drawTransform().m22(), newPageScale);
+ EXPECT_EQ(grandChild->drawTransform().m11(), newPageScale);
+ EXPECT_EQ(grandChild->drawTransform().m22(), newPageScale);
}
TEST_F(CCLayerTreeHostImplTest, scrollChildAndChangePageScaleOnMainThread)
@@ -1635,9 +1635,11 @@ TEST_F(CCLayerTreeHostImplTest, partialSwapReceivesDamageRect)
child->setPosition(FloatPoint(12, 13));
child->setAnchorPoint(FloatPoint(0, 0));
child->setBounds(IntSize(14, 15));
+ child->setContentBounds(IntSize(14, 15));
child->setDrawsContent(true);
root->setAnchorPoint(FloatPoint(0, 0));
root->setBounds(IntSize(500, 500));
+ root->setContentBounds(IntSize(500, 500));
root->setDrawsContent(true);
root->addChild(adoptPtr(child));
layerTreeHostImpl->setRootLayer(adoptPtr(root));
@@ -1695,9 +1697,11 @@ TEST_F(CCLayerTreeHostImplTest, rootLayerDoesntCreateExtraSurface)
CCLayerImpl* child = new FakeDrawableCCLayerImpl(2);
child->setAnchorPoint(FloatPoint(0, 0));
child->setBounds(IntSize(10, 10));
+ child->setContentBounds(IntSize(10, 10));
child->setDrawsContent(true);
root->setAnchorPoint(FloatPoint(0, 0));
root->setBounds(IntSize(10, 10));
+ root->setContentBounds(IntSize(10, 10));
root->setDrawsContent(true);
root->setOpacity(0.7f);
root->addChild(adoptPtr(child));
@@ -1709,6 +1713,7 @@ TEST_F(CCLayerTreeHostImplTest, rootLayerDoesntCreateExtraSurface)
EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
EXPECT_EQ(1u, frame.renderSurfaceLayerList->size());
EXPECT_EQ(1u, frame.renderPasses.size());
+ m_hostImpl->didDrawAllLayers(frame);
}
} // namespace
@@ -3572,12 +3577,12 @@ struct RenderPassRemovalTestData : public CCLayerTreeHostImpl::FrameData {
class CCTestRenderPass: public CCRenderPass {
public:
- static PassOwnPtr<CCRenderPass> create(CCRenderSurface* targetSurface, int id) { return adoptPtr(new CCTestRenderPass(targetSurface, id)); }
+ static PassOwnPtr<CCRenderPass> create(CCRenderSurface* renderSurface, int id) { return adoptPtr(new CCTestRenderPass(renderSurface, id)); }
void appendQuad(PassOwnPtr<CCDrawQuad> quad) { m_quadList.append(quad); }
protected:
- CCTestRenderPass(CCRenderSurface* targetSurface, int id) : CCRenderPass(targetSurface, id) { }
+ CCTestRenderPass(CCRenderSurface* renderSurface, int id) : CCRenderPass(renderSurface, id) { }
};
class CCTestRenderer : public LayerRendererChromium, public CCRendererClient {
@@ -3693,7 +3698,7 @@ static void configureRenderPassTestData(const char* testScript, RenderPassRemova
IntRect quadRect = IntRect(0, 0, 1, 1);
IntRect contentsChangedRect = contentsChanged ? quadRect : IntRect();
- OwnPtr<CCRenderPassDrawQuad> quad = CCRenderPassDrawQuad::create(testData.sharedQuadState.get(), quadRect, newRenderPassId, isReplica, WebKit::WebTransformationMatrix(), WebKit::WebFilterOperations(), WebKit::WebFilterOperations(), 1, contentsChangedRect);
+ OwnPtr<CCRenderPassDrawQuad> quad = CCRenderPassDrawQuad::create(testData.sharedQuadState.get(), quadRect, newRenderPassId, isReplica, 1, contentsChangedRect);
static_cast<CCTestRenderPass*>(renderPass.get())->appendQuad(quad.release());
}
}
diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
index ca3e21c3d..ea7678b02 100644
--- a/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
@@ -1160,9 +1160,9 @@ public:
int paintContentsCount() { return m_paintContentsCount; }
void resetPaintContentsCount() { m_paintContentsCount = 0; }
- virtual void update(CCTextureUpdater& updater, const CCOcclusionTracker* occlusion) OVERRIDE
+ virtual void update(CCTextureUpdater& updater, const CCOcclusionTracker* occlusion, CCRenderingStats& stats) OVERRIDE
{
- ContentLayerChromium::update(updater, occlusion);
+ ContentLayerChromium::update(updater, occlusion, stats);
m_paintContentsCount++;
}
@@ -1301,7 +1301,6 @@ public:
// The root layer is scaled by 2x.
WebTransformationMatrix rootScreenSpaceTransform = scaleTransform;
WebTransformationMatrix rootDrawTransform = scaleTransform;
- rootDrawTransform.translate(root->bounds().width() * 0.5, root->bounds().height() * 0.5);
EXPECT_EQ(rootDrawTransform, root->drawTransform());
EXPECT_EQ(rootScreenSpaceTransform, root->screenSpaceTransform());
@@ -1311,7 +1310,6 @@ public:
childScreenSpaceTransform.translate(2, 2);
WebTransformationMatrix childDrawTransform = scaleTransform;
childDrawTransform.translate(2, 2);
- childDrawTransform.translate(child->bounds().width() * 0.5, child->bounds().height() * 0.5);
EXPECT_EQ(childDrawTransform, child->drawTransform());
EXPECT_EQ(childScreenSpaceTransform, child->screenSpaceTransform());
@@ -1576,7 +1574,7 @@ class TestLayerChromium : public LayerChromium {
public:
static PassRefPtr<TestLayerChromium> create() { return adoptRef(new TestLayerChromium()); }
- virtual void update(CCTextureUpdater&, const CCOcclusionTracker* occlusion) OVERRIDE
+ virtual void update(CCTextureUpdater&, const CCOcclusionTracker* occlusion, CCRenderingStats&) OVERRIDE
{
// Gain access to internals of the CCOcclusionTracker.
const TestCCOcclusionTracker* testOcclusion = static_cast<const TestCCOcclusionTracker*>(occlusion);
diff --git a/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp b/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp
index b559db12c..596b0692c 100644
--- a/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp
+++ b/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp
@@ -256,16 +256,12 @@ protected:
void calcDrawEtc(TestContentLayerImpl* root)
{
ASSERT(root == m_root.get());
- Vector<CCLayerImpl*> dummyLayerList;
int dummyMaxTextureSize = 512;
CCLayerSorter layerSorter;
ASSERT(!root->renderSurface());
- root->createRenderSurface();
- root->renderSurface()->setContentRect(IntRect(IntPoint::zero(), root->bounds()));
- m_renderSurfaceLayerListImpl.append(m_root.get());
- CCLayerTreeHostCommon::calculateDrawTransforms(root, root, identityMatrix, identityMatrix, m_renderSurfaceLayerListImpl, dummyLayerList, &layerSorter, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(root, root->bounds(), 1, &layerSorter, dummyMaxTextureSize, m_renderSurfaceLayerListImpl);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(m_renderSurfaceLayerListImpl, root->renderSurface()->contentRect());
@@ -275,15 +271,11 @@ protected:
void calcDrawEtc(TestContentLayerChromium* root)
{
ASSERT(root == m_root.get());
- Vector<RefPtr<LayerChromium> > dummyLayerList;
int dummyMaxTextureSize = 512;
ASSERT(!root->renderSurface());
- root->createRenderSurface();
- root->renderSurface()->setContentRect(IntRect(IntPoint::zero(), root->bounds()));
- m_renderSurfaceLayerListChromium.append(m_root);
- CCLayerTreeHostCommon::calculateDrawTransforms(root, root, identityMatrix, identityMatrix, m_renderSurfaceLayerListChromium, dummyLayerList, dummyMaxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransforms(root, root->bounds(), 1, dummyMaxTextureSize, m_renderSurfaceLayerListChromium);
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(m_renderSurfaceLayerListChromium, root->renderSurface()->contentRect());
diff --git a/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp b/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp
index 526ab4e59..9eff157bc 100644
--- a/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp
+++ b/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp
@@ -58,17 +58,15 @@ private:
typedef CCLayerIterator<CCLayerImpl, Vector<CCLayerImpl*>, CCRenderSurface, CCLayerIteratorActions::FrontToBack> CCLayerIteratorType;
-static PassOwnPtr<CCTiledLayerImpl> makeLayer(CCTiledLayerImpl* parent, const WebTransformationMatrix& originTransform, const IntRect& layerRect, float opacity, bool opaque, const IntRect& layerOpaqueRect, Vector<CCLayerImpl*>& surfaceLayerList)
+static PassOwnPtr<CCTiledLayerImpl> makeLayer(CCTiledLayerImpl* parent, const WebTransformationMatrix& drawTransform, const IntRect& layerRect, float opacity, bool opaque, const IntRect& layerOpaqueRect, Vector<CCLayerImpl*>& surfaceLayerList)
{
OwnPtr<CCTiledLayerImpl> layer = CCTiledLayerImpl::create(1);
OwnPtr<CCLayerTilingData> tiler = CCLayerTilingData::create(IntSize(100, 100), CCLayerTilingData::NoBorderTexels);
tiler->setBounds(layerRect.size());
layer->setTilingData(*tiler);
layer->setSkipsDraw(false);
- WebTransformationMatrix drawTransform = originTransform;
- drawTransform.translate(0.5 * layerRect.width(), 0.5 * layerRect.height());
layer->setDrawTransform(drawTransform);
- layer->setScreenSpaceTransform(originTransform);
+ layer->setScreenSpaceTransform(drawTransform);
layer->setVisibleContentRect(layerRect);
layer->setDrawOpacity(opacity);
layer->setOpaque(opaque);
diff --git a/Source/WebKit/chromium/tests/CCRenderSurfaceTest.cpp b/Source/WebKit/chromium/tests/CCRenderSurfaceTest.cpp
index a989cd602..c95d71e84 100644
--- a/Source/WebKit/chromium/tests/CCRenderSurfaceTest.cpp
+++ b/Source/WebKit/chromium/tests/CCRenderSurfaceTest.cpp
@@ -86,7 +86,6 @@ TEST(CCRenderSurfaceTest, verifySurfaceChangesAreTrackedProperly)
EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(renderSurface->setDrawOpacity(0.5));
EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(renderSurface->setDrawTransform(dummyMatrix));
EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(renderSurface->setReplicaDrawTransform(dummyMatrix));
- EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(renderSurface->setOriginTransform(dummyMatrix));
EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(renderSurface->clearLayerList());
}
@@ -106,7 +105,7 @@ TEST(CCRenderSurfaceTest, sanityCheckSurfaceCreatesCorrectSharedQuadState)
origin.translate(30, 40);
- renderSurface->setOriginTransform(origin);
+ renderSurface->setDrawTransform(origin);
renderSurface->setContentRect(contentRect);
renderSurface->setClipRect(clipRect);
renderSurface->setScissorRect(clipRect);
diff --git a/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.cpp b/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.cpp
index 7778549b6..ec2105327 100644
--- a/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.cpp
+++ b/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.cpp
@@ -46,7 +46,7 @@ void FakeLayerTextureUpdater::Texture::updateRect(CCResourceProvider* resourcePr
m_layer->updateRect();
}
-void FakeLayerTextureUpdater::Texture::prepareRect(const IntRect&)
+void FakeLayerTextureUpdater::Texture::prepareRect(const IntRect&, WebCore::CCRenderingStats&)
{
m_layer->prepareRect();
}
@@ -62,7 +62,7 @@ FakeLayerTextureUpdater::~FakeLayerTextureUpdater()
{
}
-void FakeLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize&, float, float, IntRect& resultingOpaqueRect)
+void FakeLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize&, float, float, IntRect& resultingOpaqueRect, CCRenderingStats&)
{
m_prepareCount++;
m_lastUpdateRect = contentRect;
@@ -115,9 +115,9 @@ void FakeTiledLayerChromium::setNeedsDisplayRect(const FloatRect& rect)
TiledLayerChromium::setNeedsDisplayRect(rect);
}
-void FakeTiledLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker* occlusion)
+void FakeTiledLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker* occlusion, CCRenderingStats& stats)
{
- updateContentRect(updater, visibleContentRect(), occlusion);
+ updateContentRect(updater, visibleContentRect(), occlusion, stats);
}
void FakeTiledLayerChromium::setTexturePriorities(const CCPriorityCalculator& calculator)
diff --git a/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h b/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h
index be681d71c..de1eb66c6 100644
--- a/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h
+++ b/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h
@@ -50,7 +50,7 @@ public:
virtual ~Texture();
virtual void updateRect(WebCore::CCResourceProvider* , const WebCore::IntRect&, const WebCore::IntRect&) OVERRIDE;
- virtual void prepareRect(const WebCore::IntRect&) OVERRIDE;
+ virtual void prepareRect(const WebCore::IntRect&, WebCore::CCRenderingStats&) OVERRIDE;
private:
FakeLayerTextureUpdater* m_layer;
@@ -62,7 +62,7 @@ public:
virtual PassOwnPtr<WebCore::LayerTextureUpdater::Texture> createTexture(WebCore::CCPrioritizedTextureManager*) OVERRIDE;
virtual SampledTexelFormat sampledTexelFormat(GC3Denum) OVERRIDE { return SampledTexelFormatRGBA; }
- virtual void prepareToUpdate(const WebCore::IntRect& contentRect, const WebCore::IntSize&, float, float, WebCore::IntRect& resultingOpaqueRect) OVERRIDE;
+ virtual void prepareToUpdate(const WebCore::IntRect& contentRect, const WebCore::IntSize&, float, float, WebCore::IntRect& resultingOpaqueRect, WebCore::CCRenderingStats&) OVERRIDE;
// Sets the rect to invalidate during the next call to prepareToUpdate(). After the next
// call to prepareToUpdate() the rect is reset.
void setRectToInvalidate(const WebCore::IntRect&, FakeTiledLayerChromium*);
@@ -122,7 +122,7 @@ public:
const WebCore::FloatRect& lastNeedsDisplayRect() const { return m_lastNeedsDisplayRect; }
// Updates the visibleContentRect().
- virtual void update(WebCore::CCTextureUpdater&, const WebCore::CCOcclusionTracker*) OVERRIDE;
+ virtual void update(WebCore::CCTextureUpdater&, const WebCore::CCOcclusionTracker*, WebCore::CCRenderingStats&) OVERRIDE;
virtual void setTexturePriorities(const WebCore::CCPriorityCalculator&) OVERRIDE;
diff --git a/Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp b/Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp
index c206dda5e..ace7410c3 100644
--- a/Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp
+++ b/Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp
@@ -33,6 +33,7 @@
#include "WebCompositor.h"
#include "WebKit.h"
#include "cc/CCGraphicsContext.h"
+#include "cc/CCRenderingStats.h"
#include "cc/CCTextureUpdater.h"
#include "platform/WebKitPlatformSupport.h"
#include "platform/WebThread.h"
@@ -151,8 +152,8 @@ TEST(Canvas2DLayerBridgeTest2, testClearClient)
RefPtr<LayerChromium> layer = bridge->layer();
bridge.clear();
CCTextureUpdater updater;
- layer->update(updater, 0);
+ CCRenderingStats stats;
+ layer->update(updater, 0, stats);
}
} // namespace
-
diff --git a/Source/WebKit/chromium/tests/ContentLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/ContentLayerChromiumTest.cpp
index fcfcce114..007bea446 100644
--- a/Source/WebKit/chromium/tests/ContentLayerChromiumTest.cpp
+++ b/Source/WebKit/chromium/tests/ContentLayerChromiumTest.cpp
@@ -30,6 +30,7 @@
#include "CCLayerTreeTestCommon.h"
#include "GraphicsContext.h"
#include "OpaqueRectTrackingContentLayerDelegate.h"
+#include "cc/CCRenderingStats.h"
#include "skia/ext/platform_canvas.h"
#include <gtest/gtest.h>
@@ -102,7 +103,8 @@ TEST(ContentLayerChromiumTest, ContentLayerPainterWithDeviceScale)
RefPtr<BitmapCanvasLayerTextureUpdater> updater = BitmapCanvasLayerTextureUpdater::create(ContentLayerPainter::create(&delegate));
IntRect resultingOpaqueRect;
- updater->prepareToUpdate(contentRect, IntSize(256, 256), contentsScale, contentsScale, resultingOpaqueRect);
+ CCRenderingStats stats;
+ updater->prepareToUpdate(contentRect, IntSize(256, 256), contentsScale, contentsScale, resultingOpaqueRect, stats);
EXPECT_INT_RECT_EQ(opaqueRectInContentSpace, resultingOpaqueRect);
}
diff --git a/Source/WebKit/chromium/tests/IDBAbortOnCorruptTest.cpp b/Source/WebKit/chromium/tests/IDBAbortOnCorruptTest.cpp
index f53ad50d1..d9e3d697b 100644
--- a/Source/WebKit/chromium/tests/IDBAbortOnCorruptTest.cpp
+++ b/Source/WebKit/chromium/tests/IDBAbortOnCorruptTest.cpp
@@ -24,6 +24,8 @@
*/
#include "config.h"
+#include "IDBCursorBackendInterface.h"
+#include "IDBDatabaseBackendInterface.h"
#include "IDBFactoryBackendImpl.h"
#include "IDBFakeBackingStore.h"
#include "SecurityOrigin.h"
diff --git a/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp b/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp
index eb3c85abc..5c01e9ecc 100644
--- a/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp
+++ b/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp
@@ -25,6 +25,7 @@
#include "config.h"
#include "IDBBackingStore.h"
+#include "IDBCursorBackendInterface.h"
#include "IDBDatabaseBackendImpl.h"
#include "IDBFactoryBackendImpl.h"
#include "IDBFakeBackingStore.h"
diff --git a/Source/WebKit/chromium/tests/IDBFakeBackingStore.h b/Source/WebKit/chromium/tests/IDBFakeBackingStore.h
index 08405ce0a..536d785b9 100644
--- a/Source/WebKit/chromium/tests/IDBFakeBackingStore.h
+++ b/Source/WebKit/chromium/tests/IDBFakeBackingStore.h
@@ -59,7 +59,6 @@ public:
virtual void deleteIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId) OVERRIDE { }
virtual bool putIndexDataForRecord(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const ObjectStoreRecordIdentifier*) OVERRIDE { return false; }
virtual bool deleteIndexDataForRecord(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const ObjectStoreRecordIdentifier*) OVERRIDE { return false; }
- virtual String getObjectViaIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&) OVERRIDE { return String(); }
virtual PassRefPtr<IDBKey> getPrimaryKeyViaIndex(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&) OVERRIDE { return PassRefPtr<IDBKey>(); }
virtual bool keyExistsInIndex(int64_t databaseid, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey) OVERRIDE { return false; }
diff --git a/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp b/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp
index 1b6b8028b..d861164f6 100644
--- a/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp
+++ b/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp
@@ -80,8 +80,9 @@ public:
, m_memoryAllocationLimitBytes(CCPrioritizedTextureManager::defaultMemoryAllocationLimit())
{
m_rootLayer->createRenderSurface();
- m_rootRenderPass = CCRenderPass::create(m_rootLayer->renderSurface(), m_rootLayer->id());
- m_renderPasses.append(m_rootRenderPass.get());
+ OwnPtr<CCRenderPass> rootRenderPass = CCRenderPass::create(m_rootLayer->renderSurface(), m_rootLayer->id());
+ m_renderPassesInDrawOrder.append(rootRenderPass.get());
+ m_renderPasses.set(m_rootLayer->id(), rootRenderPass.release());
}
// CCRendererClient methods.
@@ -96,8 +97,9 @@ public:
// Methods added for test.
int setFullRootLayerDamageCount() const { return m_setFullRootLayerDamageCount; }
- CCRenderPass* rootRenderPass() { return m_rootRenderPass.get(); }
- const CCRenderPassList& renderPasses() { return m_renderPasses; }
+ CCRenderPass* rootRenderPass() { return m_renderPassesInDrawOrder.last(); }
+ const CCRenderPassList& renderPassesInDrawOrder() const { return m_renderPassesInDrawOrder; }
+ const CCRenderPassIdHashMap& renderPasses() const { return m_renderPasses; }
size_t memoryAllocationLimitBytes() const { return m_memoryAllocationLimitBytes; }
@@ -105,8 +107,8 @@ private:
int m_setFullRootLayerDamageCount;
DebugScopedSetImplThread m_implThread;
OwnPtr<CCLayerImpl> m_rootLayer;
- OwnPtr<CCRenderPass> m_rootRenderPass;
- CCRenderPassList m_renderPasses;
+ CCRenderPassList m_renderPassesInDrawOrder;
+ CCRenderPassIdHashMap m_renderPasses;
size_t m_memoryAllocationLimitBytes;
};
@@ -222,7 +224,7 @@ TEST_F(LayerRendererChromiumTest, DiscardedBackbufferIsRecreatedForScopeDuration
EXPECT_EQ(1, m_mockClient.setFullRootLayerDamageCount());
m_layerRendererChromium.setVisible(true);
- m_layerRendererChromium.drawFrame(m_mockClient.renderPasses(), FloatRect());
+ m_layerRendererChromium.drawFrame(m_mockClient.renderPassesInDrawOrder(), m_mockClient.renderPasses(), FloatRect());
EXPECT_FALSE(m_layerRendererChromium.isFramebufferDiscarded());
swapBuffers();
@@ -237,7 +239,7 @@ TEST_F(LayerRendererChromiumTest, FramebufferDiscardedAfterReadbackWhenNotVisibl
EXPECT_EQ(1, m_mockClient.setFullRootLayerDamageCount());
char pixels[4];
- m_layerRendererChromium.drawFrame(m_mockClient.renderPasses(), FloatRect());
+ m_layerRendererChromium.drawFrame(m_mockClient.renderPassesInDrawOrder(), m_mockClient.renderPasses(), FloatRect());
EXPECT_FALSE(m_layerRendererChromium.isFramebufferDiscarded());
m_layerRendererChromium.getFramebufferPixels(pixels, IntRect(0, 0, 1, 1));
@@ -418,8 +420,7 @@ TEST(LayerRendererChromiumTest2, opaqueBackground)
EXPECT_TRUE(layerRendererChromium.initialize());
- layerRendererChromium.drawFrame(mockClient.renderPasses(), FloatRect());
- layerRendererChromium.finishDrawingFrame();
+ layerRendererChromium.drawFrame(mockClient.renderPassesInDrawOrder(), mockClient.renderPasses(), FloatRect());
// On DEBUG builds, render passes with opaque background clear to blue to
// easily see regions that were not drawn on the screen.
@@ -442,8 +443,7 @@ TEST(LayerRendererChromiumTest2, transparentBackground)
EXPECT_TRUE(layerRendererChromium.initialize());
- layerRendererChromium.drawFrame(mockClient.renderPasses(), FloatRect());
- layerRendererChromium.finishDrawingFrame();
+ layerRendererChromium.drawFrame(mockClient.renderPassesInDrawOrder(), mockClient.renderPasses(), FloatRect());
EXPECT_EQ(1, context->clearCount());
}
diff --git a/Source/WebKit/chromium/tests/MemoryInfo.cpp b/Source/WebKit/chromium/tests/MemoryInfo.cpp
new file mode 100644
index 000000000..0e093aee4
--- /dev/null
+++ b/Source/WebKit/chromium/tests/MemoryInfo.cpp
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "MemoryInfo.h"
+
+#include <gtest/gtest.h>
+
+using namespace WebCore;
+
+namespace {
+
+TEST(MemoryInfo, quantizeMemorySize)
+{
+ EXPECT_EQ(10000000u, quantizeMemorySize(1024));
+ EXPECT_EQ(10000000u, quantizeMemorySize(1024 * 1024));
+ EXPECT_EQ(410000000u, quantizeMemorySize(389472983));
+ EXPECT_EQ(39600000u, quantizeMemorySize(38947298));
+ EXPECT_EQ(29400000u, quantizeMemorySize(28947298));
+ EXPECT_EQ(19300000u, quantizeMemorySize(18947298));
+ EXPECT_EQ(14300000u, quantizeMemorySize(13947298));
+ EXPECT_EQ(10000000u, quantizeMemorySize(3894729));
+ EXPECT_EQ(10000000u, quantizeMemorySize(389472));
+ EXPECT_EQ(10000000u, quantizeMemorySize(38947));
+ EXPECT_EQ(10000000u, quantizeMemorySize(3894));
+ EXPECT_EQ(10000000u, quantizeMemorySize(389));
+ EXPECT_EQ(10000000u, quantizeMemorySize(38));
+ EXPECT_EQ(10000000u, quantizeMemorySize(3));
+ EXPECT_EQ(10000000u, quantizeMemorySize(1));
+ EXPECT_EQ(10000000u, quantizeMemorySize(0));
+}
+
+} // namespace
diff --git a/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp
index 11bf115b5..e39fe7e56 100644
--- a/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp
+++ b/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp
@@ -35,6 +35,7 @@
#include "LayerPainterChromium.h"
#include "WebCompositor.h"
#include "cc/CCOverdrawMetrics.h"
+#include "cc/CCRenderingStats.h"
#include "cc/CCSingleThreadProxy.h" // For DebugScopedSetImplThread
#include <gtest/gtest.h>
#include <public/WebTransformationMatrix.h>
@@ -94,6 +95,7 @@ public:
OwnPtr<CCGraphicsContext> m_context;
OwnPtr<CCResourceProvider> m_resourceProvider;
CCTextureUpdater m_updater;
+ CCRenderingStats m_stats;
FakeTextureCopier m_copier;
FakeTextureUploader m_uploader;
CCPriorityCalculator m_priorityCalculator;
@@ -116,7 +118,7 @@ TEST_F(TiledLayerChromiumTest, pushDirtyTiles)
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats);
updateTextures();
layer->pushPropertiesTo(layerImpl.get());
@@ -129,7 +131,7 @@ TEST_F(TiledLayerChromiumTest, pushDirtyTiles)
// ....but then only update one of them.
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0, m_stats);
layer->pushPropertiesTo(layerImpl.get());
// We should only have the first tile since the other tile was invalidated but not painted.
@@ -147,14 +149,13 @@ TEST_F(TiledLayerChromiumTest, pushOccludedDirtyTiles)
// The tile size is 100x100, so this invalidates and then paints two tiles.
layer->setBounds(IntSize(100, 200));
- layer->setDrawTransform(WebTransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0));
layer->setVisibleContentRect(IntRect(0, 0, 100, 200));
layer->invalidateContentRect(IntRect(0, 0, 100, 200));
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), &occluded);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), &occluded, m_stats);
updateTextures();
layer->pushPropertiesTo(layerImpl.get());
@@ -170,7 +171,7 @@ TEST_F(TiledLayerChromiumTest, pushOccludedDirtyTiles)
layer->invalidateContentRect(IntRect(0, 0, 50, 50));
// ....but the area is occluded.
occluded.setOcclusion(IntRect(0, 0, 50, 50));
- layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), &occluded);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), &occluded, m_stats);
updateTextures();
layer->pushPropertiesTo(layerImpl.get());
@@ -198,7 +199,7 @@ TEST_F(TiledLayerChromiumTest, pushDeletedTiles)
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats);
updateTextures();
layer->pushPropertiesTo(layerImpl.get());
@@ -220,7 +221,7 @@ TEST_F(TiledLayerChromiumTest, pushDeletedTiles)
// This should recreate and update the deleted textures.
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0, m_stats);
updateTextures();
layer->pushPropertiesTo(layerImpl.get());
@@ -249,7 +250,7 @@ TEST_F(TiledLayerChromiumTest, pushIdlePaintTiles)
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, visibleRect, 0);
+ layer->updateContentRect(m_updater, visibleRect, 0, m_stats);
updateTextures();
// We should need idle-painting for 3x3 tiles in the center.
@@ -265,7 +266,7 @@ TEST_F(TiledLayerChromiumTest, pushIdlePaintTiles)
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, visibleRect, 0);
+ layer->updateContentRect(m_updater, visibleRect, 0, m_stats);
EXPECT_TRUE(layer->needsIdlePaint(visibleRect));
updateTextures();
layer->pushPropertiesTo(layerImpl.get());
@@ -316,8 +317,8 @@ TEST_F(TiledLayerChromiumTest, pushTilesAfterIdlePaintFailed)
layer2->setTexturePriorities(m_priorityCalculator);
layer1->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer1->updateContentRect(m_updater, layerRect, 0);
- layer2->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0);
+ layer1->updateContentRect(m_updater, layerRect, 0, m_stats);
+ layer2->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0, m_stats);
// We should need idle-painting for both remaining tiles in layer2.
EXPECT_TRUE(layer2->needsIdlePaint(layer2Rect));
@@ -334,7 +335,7 @@ TEST_F(TiledLayerChromiumTest, pushTilesAfterIdlePaintFailed)
layer2->setTexturePriorities(m_priorityCalculator);
layer1->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer2->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0);
+ layer2->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0, m_stats);
// Oh well, commit the frame and push.
updateTextures();
@@ -354,8 +355,8 @@ TEST_F(TiledLayerChromiumTest, pushTilesAfterIdlePaintFailed)
layer2->setTexturePriorities(m_priorityCalculator);
layer1->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer2->updateContentRect(m_updater, layer2Rect, 0);
- layer1->updateContentRect(m_updater, layerRect, 0);
+ layer2->updateContentRect(m_updater, layer2Rect, 0, m_stats);
+ layer1->updateContentRect(m_updater, layerRect, 0, m_stats);
updateTextures();
layer1->pushPropertiesTo(layerImpl1.get());
@@ -381,13 +382,12 @@ TEST_F(TiledLayerChromiumTest, pushIdlePaintedOccludedTiles)
occluded.setOcclusion(IntRect(0, 0, 100, 100));
layer->setBounds(IntSize(100, 100));
- layer->setDrawTransform(WebTransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0));
layer->setVisibleContentRect(IntRect(0, 0, 100, 100));
layer->invalidateContentRect(IntRect(0, 0, 100, 100));
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), &occluded);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), &occluded, m_stats);
updateTextures();
layer->pushPropertiesTo(layerImpl.get());
@@ -412,7 +412,7 @@ TEST_F(TiledLayerChromiumTest, pushTilesMarkedDirtyDuringPaint)
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats);
updateTextures();
layer->pushPropertiesTo(layerImpl.get());
@@ -442,11 +442,11 @@ TEST_F(TiledLayerChromiumTest, pushTilesLayerMarkedDirtyDuringPaintOnNextLayer)
layer2->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer1->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0);
+ layer1->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats);
// Invalidate a tile on layer1
layer2->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer1.get());
- layer2->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0);
+ layer2->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats);
updateTextures();
layer1->pushPropertiesTo(layer1Impl.get());
@@ -482,8 +482,8 @@ TEST_F(TiledLayerChromiumTest, pushTilesLayerMarkedDirtyDuringPaintOnPreviousLay
// Invalidate a tile on layer2
layer1->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer2.get());
- layer1->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0);
- layer2->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0);
+ layer1->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats);
+ layer2->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats);
updateTextures();
layer1->pushPropertiesTo(layer1Impl.get());
layer2->pushPropertiesTo(layer2Impl.get());
@@ -517,7 +517,7 @@ TEST_F(TiledLayerChromiumTest, idlePaintOutOfMemory)
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, visibleRect, 0);
+ layer->updateContentRect(m_updater, visibleRect, 0, m_stats);
// Idle-painting should see no more priority tiles for painting.
EXPECT_FALSE(layer->needsIdlePaint(visibleRect));
@@ -530,7 +530,7 @@ TEST_F(TiledLayerChromiumTest, idlePaintOutOfMemory)
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, visibleRect, 0);
+ layer->updateContentRect(m_updater, visibleRect, 0, m_stats);
// We shouldn't signal we need another idle paint.
EXPECT_FALSE(layer->needsIdlePaint(visibleRect));
@@ -559,7 +559,7 @@ TEST_F(TiledLayerChromiumTest, idlePaintZeroSizedLayer)
textureManager->prioritizeTextures();
// Empty layers don't paint or idle-paint.
- layer->updateContentRect(m_updater, contentRect, 0);
+ layer->updateContentRect(m_updater, contentRect, 0, m_stats);
// Empty layers don't have tiles.
EXPECT_EQ(0u, layer->numPaintedTiles());
@@ -595,7 +595,7 @@ TEST_F(TiledLayerChromiumTest, idlePaintNonVisibleLayers)
// Paint / idle-paint.
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, visibleRect, 0);
+ layer->updateContentRect(m_updater, visibleRect, 0, m_stats);
// Non-visible layers don't need idle paint.
EXPECT_FALSE(layer->needsIdlePaint(visibleRect));
@@ -658,7 +658,7 @@ TEST_F(TiledLayerChromiumTest, idlePaintNonVisibleAnimatingLayers)
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, visibleRect, 0);
+ layer->updateContentRect(m_updater, visibleRect, 0, m_stats);
updateTextures();
layer->pushPropertiesTo(layerImpl.get());
}
@@ -671,7 +671,7 @@ TEST_F(TiledLayerChromiumTest, idlePaintNonVisibleAnimatingLayers)
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, visibleRect, 0);
+ layer->updateContentRect(m_updater, visibleRect, 0, m_stats);
updateTextures();
layer->pushPropertiesTo(layerImpl.get());
}
@@ -694,7 +694,7 @@ TEST_F(TiledLayerChromiumTest, invalidateFromPrepare)
layer->invalidateContentRect(IntRect(0, 0, 100, 200));
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats);
updateTextures(1000);
layer->pushPropertiesTo(layerImpl.get());
@@ -705,7 +705,7 @@ TEST_F(TiledLayerChromiumTest, invalidateFromPrepare)
layer->fakeLayerTextureUpdater()->clearPrepareCount();
// Invoke updateContentRect again. As the layer is valid updateContentRect shouldn't be invoked on
// the LayerTextureUpdater.
- layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats);
updateTextures(1000);
EXPECT_EQ(0, layer->fakeLayerTextureUpdater()->prepareCount());
@@ -713,12 +713,12 @@ TEST_F(TiledLayerChromiumTest, invalidateFromPrepare)
// setRectToInvalidate triggers invalidateContentRect() being invoked from updateContentRect.
layer->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(25, 25, 50, 50), layer.get());
layer->fakeLayerTextureUpdater()->clearPrepareCount();
- layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats);
updateTextures(1000);
EXPECT_EQ(1, layer->fakeLayerTextureUpdater()->prepareCount());
layer->fakeLayerTextureUpdater()->clearPrepareCount();
// The layer should still be invalid as updateContentRect invoked invalidate.
- layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats);
updateTextures(1000);
EXPECT_EQ(1, layer->fakeLayerTextureUpdater()->prepareCount());
}
@@ -745,7 +745,7 @@ TEST_F(TiledLayerChromiumTest, verifyUpdateRectWhenContentBoundsAreScaled)
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, contentBounds, 0);
+ layer->updateContentRect(m_updater, contentBounds, 0, m_stats);
EXPECT_FLOAT_RECT_EQ(FloatRect(0, 0, 300, 300 * 0.8), layer->updateRect());
updateTextures();
@@ -753,7 +753,7 @@ TEST_F(TiledLayerChromiumTest, verifyUpdateRectWhenContentBoundsAreScaled)
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
layer->invalidateContentRect(contentBounds);
- layer->updateContentRect(m_updater, contentBounds, 0);
+ layer->updateContentRect(m_updater, contentBounds, 0, m_stats);
EXPECT_FLOAT_RECT_EQ(FloatRect(layerBounds), layer->updateRect());
updateTextures();
@@ -762,7 +762,7 @@ TEST_F(TiledLayerChromiumTest, verifyUpdateRectWhenContentBoundsAreScaled)
layer->invalidateContentRect(partialDamage);
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, contentBounds, 0);
+ layer->updateContentRect(m_updater, contentBounds, 0, m_stats);
EXPECT_FLOAT_RECT_EQ(FloatRect(45, 80, 15, 8), layer->updateRect());
}
@@ -784,7 +784,7 @@ TEST_F(TiledLayerChromiumTest, verifyInvalidationWhenContentsScaleChanges)
// Push the tiles to the impl side and check that there is exactly one.
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0, m_stats);
updateTextures();
layer->pushPropertiesTo(layerImpl.get());
EXPECT_TRUE(layerImpl->hasTileAt(0, 0));
@@ -801,7 +801,7 @@ TEST_F(TiledLayerChromiumTest, verifyInvalidationWhenContentsScaleChanges)
// The impl side should get 2x2 tiles now.
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, IntRect(0, 0, 200, 200), 0);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 200, 200), 0, m_stats);
updateTextures();
layer->pushPropertiesTo(layerImpl.get());
EXPECT_TRUE(layerImpl->hasTileAt(0, 0));
@@ -813,7 +813,7 @@ TEST_F(TiledLayerChromiumTest, verifyInvalidationWhenContentsScaleChanges)
// impl side.
layer->setNeedsDisplay();
layer->setTexturePriorities(m_priorityCalculator);
- layer->updateContentRect(m_updater, IntRect(1, 0, 0, 1), 0);
+ layer->updateContentRect(m_updater, IntRect(1, 0, 0, 1), 0, m_stats);
textureManager->prioritizeTextures();
layer->pushPropertiesTo(layerImpl.get());
@@ -885,7 +885,7 @@ TEST_F(TiledLayerChromiumTest, resizeToSmaller)
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, IntRect(0, 0, 700, 700), 0);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 700, 700), 0, m_stats);
layer->setBounds(IntSize(200, 200));
layer->invalidateContentRect(IntRect(0, 0, 200, 200));
@@ -904,7 +904,7 @@ TEST_F(TiledLayerChromiumTest, hugeLayerUpdateCrash)
// Ensure no crash for bounds where size * size would overflow an int.
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, IntRect(0, 0, 700, 700), 0);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 700, 700), 0, m_stats);
}
TEST_F(TiledLayerChromiumTest, partialUpdates)
@@ -1047,7 +1047,7 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithoutOcclusion)
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats);
EXPECT_EQ(2, layer->fakeLayerTextureUpdater()->prepareRectCount());
}
@@ -1060,15 +1060,14 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusion)
// The tile size is 100x100.
layer->setBounds(IntSize(600, 600));
- layer->setDrawTransform(WebTransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0));
occluded.setOcclusion(IntRect(200, 200, 300, 100));
- layer->setVisibleContentRect(IntRect(IntPoint(), layer->bounds()));
+ layer->setVisibleContentRect(IntRect(IntPoint(), layer->contentBounds()));
layer->invalidateContentRect(IntRect(0, 0, 600, 600));
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats);
EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount());
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
@@ -1079,7 +1078,7 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusion)
occluded.setOcclusion(IntRect(250, 200, 300, 100));
layer->invalidateContentRect(IntRect(0, 0, 600, 600));
- layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats);
EXPECT_EQ(36-2, layer->fakeLayerTextureUpdater()->prepareRectCount());
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
@@ -1090,7 +1089,7 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusion)
occluded.setOcclusion(IntRect(250, 250, 300, 100));
layer->invalidateContentRect(IntRect(0, 0, 600, 600));
- layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats);
EXPECT_EQ(36, layer->fakeLayerTextureUpdater()->prepareRectCount());
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
@@ -1107,7 +1106,6 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndVisiblityConstraints)
// The tile size is 100x100.
layer->setBounds(IntSize(600, 600));
- layer->setDrawTransform(WebTransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0));
// The partially occluded tiles (by the 150 occlusion height) are visible beyond the occlusion, so not culled.
occluded.setOcclusion(IntRect(200, 200, 300, 150));
@@ -1116,7 +1114,7 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndVisiblityConstraints)
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, IntRect(0, 0, 600, 360), &occluded);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 600, 360), &occluded, m_stats);
EXPECT_EQ(24-3, layer->fakeLayerTextureUpdater()->prepareRectCount());
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
@@ -1131,7 +1129,7 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndVisiblityConstraints)
layer->invalidateContentRect(IntRect(0, 0, 600, 600));
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, IntRect(0, 0, 600, 350), &occluded);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 600, 350), &occluded, m_stats);
EXPECT_EQ(24-6, layer->fakeLayerTextureUpdater()->prepareRectCount());
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
@@ -1146,7 +1144,7 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndVisiblityConstraints)
layer->invalidateContentRect(IntRect(0, 0, 600, 600));
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, IntRect(0, 0, 600, 340), &occluded);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 600, 340), &occluded, m_stats);
EXPECT_EQ(24-6, layer->fakeLayerTextureUpdater()->prepareRectCount());
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
@@ -1164,14 +1162,13 @@ TEST_F(TiledLayerChromiumTest, tilesNotPaintedWithoutInvalidation)
// The tile size is 100x100.
layer->setBounds(IntSize(600, 600));
- layer->setDrawTransform(WebTransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0));
occluded.setOcclusion(IntRect(200, 200, 300, 100));
layer->setVisibleContentRect(IntRect(0, 0, 600, 600));
layer->invalidateContentRect(IntRect(0, 0, 600, 600));
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats);
EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount());
{
DebugScopedSetImplThread implThread;
@@ -1185,7 +1182,7 @@ TEST_F(TiledLayerChromiumTest, tilesNotPaintedWithoutInvalidation)
layer->fakeLayerTextureUpdater()->clearPrepareRectCount();
// Repaint without marking it dirty. The 3 culled tiles will be pre-painted now.
- layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats);
EXPECT_EQ(3, layer->fakeLayerTextureUpdater()->prepareRectCount());
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
@@ -1207,14 +1204,14 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndTransforms)
WebTransformationMatrix screenTransform;
screenTransform.scale(0.5);
layer->setScreenSpaceTransform(screenTransform);
- layer->setDrawTransform(screenTransform * WebTransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0));
+ layer->setDrawTransform(screenTransform);
occluded.setOcclusion(IntRect(100, 100, 150, 50));
- layer->setVisibleContentRect(IntRect(IntPoint(), layer->bounds()));
+ layer->setVisibleContentRect(IntRect(IntPoint(), layer->contentBounds()));
layer->invalidateContentRect(IntRect(0, 0, 600, 600));
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats);
EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount());
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
@@ -1235,14 +1232,17 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndScaling)
// pixels, which means none should be occluded.
layer->setContentsScale(0.5);
layer->setBounds(IntSize(600, 600));
- layer->setDrawTransform(WebTransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0));
+ WebTransformationMatrix drawTransform;
+ drawTransform.scale(1 / layer->contentsScale());
+ layer->setDrawTransform(drawTransform);
+ layer->setScreenSpaceTransform(drawTransform);
occluded.setOcclusion(IntRect(200, 200, 300, 100));
- layer->setVisibleContentRect(IntRect(IntPoint(), layer->bounds()));
+ layer->setVisibleContentRect(IntRect(IntPoint(), layer->contentBounds()));
layer->invalidateContentRect(IntRect(0, 0, 600, 600));
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats);
// The content is half the size of the layer (so the number of tiles is fewer).
// In this case, the content is 300x300, and since the tile size is 100, the
// number of tiles 3x3.
@@ -1258,11 +1258,11 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndScaling)
// a different layer space. In this case the occluded region catches the
// blown up tiles.
occluded.setOcclusion(IntRect(200, 200, 300, 200));
- layer->setVisibleContentRect(IntRect(IntPoint(), layer->bounds()));
+ layer->setVisibleContentRect(IntRect(IntPoint(), layer->contentBounds()));
layer->invalidateContentRect(IntRect(0, 0, 600, 600));
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats);
EXPECT_EQ(9-1, layer->fakeLayerTextureUpdater()->prepareRectCount());
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
@@ -1275,14 +1275,14 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndScaling)
WebTransformationMatrix screenTransform;
screenTransform.scale(0.5);
layer->setScreenSpaceTransform(screenTransform);
- layer->setDrawTransform(screenTransform * WebTransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0));
+ layer->setDrawTransform(screenTransform);
occluded.setOcclusion(IntRect(100, 100, 150, 100));
- layer->setVisibleContentRect(IntRect(IntPoint(), layer->bounds()));
+ layer->setVisibleContentRect(IntRect(IntPoint(), layer->contentBounds()));
layer->invalidateContentRect(IntRect(0, 0, 600, 600));
layer->setTexturePriorities(m_priorityCalculator);
textureManager->prioritizeTextures();
- layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded);
+ layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats);
EXPECT_EQ(9-1, layer->fakeLayerTextureUpdater()->prepareRectCount());
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
@@ -1306,7 +1306,6 @@ TEST_F(TiledLayerChromiumTest, visibleContentOpaqueRegion)
IntRect visibleBounds = IntRect(0, 0, 100, 150);
layer->setBounds(contentBounds.size());
- layer->setDrawTransform(WebTransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0));
layer->setVisibleContentRect(visibleBounds);
layer->setDrawOpacity(1);
@@ -1316,7 +1315,7 @@ TEST_F(TiledLayerChromiumTest, visibleContentOpaqueRegion)
// If the layer doesn't paint opaque content, then the visibleContentOpaqueRegion should be empty.
layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
layer->invalidateContentRect(contentBounds);
- layer->updateContentRect(m_updater, contentBounds, &occluded);
+ layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats);
opaqueContents = layer->visibleContentOpaqueRegion();
EXPECT_TRUE(opaqueContents.isEmpty());
@@ -1329,7 +1328,7 @@ TEST_F(TiledLayerChromiumTest, visibleContentOpaqueRegion)
opaquePaintRect = IntRect(10, 10, 90, 190);
layer->fakeLayerTextureUpdater()->setOpaquePaintRect(opaquePaintRect);
layer->invalidateContentRect(contentBounds);
- layer->updateContentRect(m_updater, contentBounds, &occluded);
+ layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats);
updateTextures();
opaqueContents = layer->visibleContentOpaqueRegion();
EXPECT_EQ_RECT(intersection(opaquePaintRect, visibleBounds), opaqueContents.bounds());
@@ -1342,7 +1341,7 @@ TEST_F(TiledLayerChromiumTest, visibleContentOpaqueRegion)
// If we paint again without invalidating, the same stuff should be opaque.
layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
- layer->updateContentRect(m_updater, contentBounds, &occluded);
+ layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats);
updateTextures();
opaqueContents = layer->visibleContentOpaqueRegion();
EXPECT_EQ_RECT(intersection(opaquePaintRect, visibleBounds), opaqueContents.bounds());
@@ -1357,7 +1356,7 @@ TEST_F(TiledLayerChromiumTest, visibleContentOpaqueRegion)
// not be affected.
layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
layer->invalidateContentRect(IntRect(0, 0, 1, 1));
- layer->updateContentRect(m_updater, contentBounds, &occluded);
+ layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats);
updateTextures();
opaqueContents = layer->visibleContentOpaqueRegion();
EXPECT_EQ_RECT(intersection(opaquePaintRect, visibleBounds), opaqueContents.bounds());
@@ -1372,7 +1371,7 @@ TEST_F(TiledLayerChromiumTest, visibleContentOpaqueRegion)
// not be affected.
layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
layer->invalidateContentRect(IntRect(10, 10, 1, 1));
- layer->updateContentRect(m_updater, contentBounds, &occluded);
+ layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats);
updateTextures();
opaqueContents = layer->visibleContentOpaqueRegion();
EXPECT_EQ_RECT(intersection(IntRect(10, 100, 90, 100), visibleBounds), opaqueContents.bounds());
@@ -1400,7 +1399,6 @@ TEST_F(TiledLayerChromiumTest, pixelsPaintedMetrics)
IntRect visibleBounds = IntRect(0, 0, 100, 300);
layer->setBounds(contentBounds.size());
- layer->setDrawTransform(WebTransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0));
layer->setVisibleContentRect(visibleBounds);
layer->setDrawOpacity(1);
@@ -1410,7 +1408,7 @@ TEST_F(TiledLayerChromiumTest, pixelsPaintedMetrics)
// Invalidates and paints the whole layer.
layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
layer->invalidateContentRect(contentBounds);
- layer->updateContentRect(m_updater, contentBounds, &occluded);
+ layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats);
updateTextures();
opaqueContents = layer->visibleContentOpaqueRegion();
EXPECT_TRUE(opaqueContents.isEmpty());
@@ -1425,7 +1423,7 @@ TEST_F(TiledLayerChromiumTest, pixelsPaintedMetrics)
layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
layer->invalidateContentRect(IntRect(0, 0, 1, 1));
layer->invalidateContentRect(IntRect(50, 200, 10, 10));
- layer->updateContentRect(m_updater, contentBounds, &occluded);
+ layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats);
updateTextures();
opaqueContents = layer->visibleContentOpaqueRegion();
EXPECT_TRUE(opaqueContents.isEmpty());
@@ -1653,7 +1651,7 @@ TEST_F(TiledLayerChromiumTest, nonIntegerContentsScaleIsNotDistortedDuringPaint)
textureManager->prioritizeTextures();
// Update the whole tile.
- layer->updateContentRect(m_updater, contentRect, 0);
+ layer->updateContentRect(m_updater, contentRect, 0, m_stats);
layer->trackingLayerPainter()->resetPaintedRect();
EXPECT_INT_RECT_EQ(IntRect(), layer->trackingLayerPainter()->paintedRect());
@@ -1665,7 +1663,7 @@ TEST_F(TiledLayerChromiumTest, nonIntegerContentsScaleIsNotDistortedDuringPaint)
// Invalidate the entire layer in content space. When painting, the rect given to webkit should match the layer's bounds.
layer->invalidateContentRect(contentRect);
- layer->updateContentRect(m_updater, contentRect, 0);
+ layer->updateContentRect(m_updater, contentRect, 0, m_stats);
EXPECT_INT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect());
}
@@ -1688,7 +1686,7 @@ TEST_F(TiledLayerChromiumTest, nonIntegerContentsScaleIsNotDistortedDuringInvali
textureManager->prioritizeTextures();
// Update the whole tile.
- layer->updateContentRect(m_updater, contentRect, 0);
+ layer->updateContentRect(m_updater, contentRect, 0, m_stats);
layer->trackingLayerPainter()->resetPaintedRect();
EXPECT_INT_RECT_EQ(IntRect(), layer->trackingLayerPainter()->paintedRect());
@@ -1700,7 +1698,7 @@ TEST_F(TiledLayerChromiumTest, nonIntegerContentsScaleIsNotDistortedDuringInvali
// Invalidate the entire layer in layer space. When painting, the rect given to webkit should match the layer's bounds.
layer->setNeedsDisplayRect(layerRect);
- layer->updateContentRect(m_updater, contentRect, 0);
+ layer->updateContentRect(m_updater, contentRect, 0, m_stats);
EXPECT_INT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect());
}
diff --git a/Source/WebKit/chromium/tests/WebViewTest.cpp b/Source/WebKit/chromium/tests/WebViewTest.cpp
index 33ce2f70c..3ca1094d0 100644
--- a/Source/WebKit/chromium/tests/WebViewTest.cpp
+++ b/Source/WebKit/chromium/tests/WebViewTest.cpp
@@ -254,7 +254,9 @@ TEST_F(WebViewTest, AutoResizeFixedHeightAndWidthOverflow)
expectedWidth, expectedHeight, VisibleHorizontalScrollbar, NoVerticalScrollbar);
}
-TEST_F(WebViewTest, AutoResizeInBetweenSizes)
+// Next three tests disabled for https://bugs.webkit.org/show_bug.cgi?id=92318 .
+// It seems we can run three AutoResize tests, then the next one breaks.
+TEST_F(WebViewTest, DISABLED_AutoResizeInBetweenSizes)
{
WebSize minAutoResize(90, 95);
WebSize maxAutoResize(200, 300);
@@ -266,7 +268,7 @@ TEST_F(WebViewTest, AutoResizeInBetweenSizes)
expectedWidth, expectedHeight, NoHorizontalScrollbar, NoVerticalScrollbar);
}
-TEST_F(WebViewTest, AutoResizeOverflowSizes)
+TEST_F(WebViewTest, DISABLED_AutoResizeOverflowSizes)
{
WebSize minAutoResize(90, 95);
WebSize maxAutoResize(200, 300);
@@ -278,7 +280,7 @@ TEST_F(WebViewTest, AutoResizeOverflowSizes)
expectedWidth, expectedHeight, VisibleHorizontalScrollbar, VisibleVerticalScrollbar);
}
-TEST_F(WebViewTest, AutoResizeMaxSize)
+TEST_F(WebViewTest, DISABLED_AutoResizeMaxSize)
{
WebSize minAutoResize(90, 95);
WebSize maxAutoResize(200, 300);