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

Side by Side Diff: Source/core/testing/Internals.cpp

Issue 358913003: Get rid of one-off code in ScrollingCoordinator to handle graphics layer offsets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/compositing/CompositedLayerMapping.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 unsigned count = 0; 1297 unsigned count = 0;
1298 for (TouchEventTargetSet::const_iterator iter = touchHandlers->begin(); iter != touchHandlers->end(); ++iter) 1298 for (TouchEventTargetSet::const_iterator iter = touchHandlers->begin(); iter != touchHandlers->end(); ++iter)
1299 count += iter->value; 1299 count += iter->value;
1300 return count; 1300 return count;
1301 } 1301 }
1302 1302
1303 static RenderLayer* findRenderLayerForGraphicsLayer(RenderLayer* searchRoot, Gra phicsLayer* graphicsLayer, IntSize* layerOffset, String* layerType) 1303 static RenderLayer* findRenderLayerForGraphicsLayer(RenderLayer* searchRoot, Gra phicsLayer* graphicsLayer, IntSize* layerOffset, String* layerType)
1304 { 1304 {
1305 *layerOffset = IntSize(); 1305 *layerOffset = IntSize();
1306 if (searchRoot->hasCompositedLayerMapping() && graphicsLayer == searchRoot-> compositedLayerMapping()->mainGraphicsLayer()) { 1306 if (searchRoot->hasCompositedLayerMapping() && graphicsLayer == searchRoot-> compositedLayerMapping()->mainGraphicsLayer()) {
1307 CompositedLayerMappingPtr compositedLayerMapping = searchRoot->composite dLayerMapping(); 1307 LayoutRect rect;
1308 LayoutSize offset = compositedLayerMapping->contentOffsetInCompositingLa yer(); 1308 RenderLayer::mapRectToPaintBackingCoordinates(searchRoot->renderer(), re ct);
1309 *layerOffset = IntSize(offset.width(), offset.height()); 1309 *layerOffset = IntSize(rect.x(), rect.y());
1310 return searchRoot; 1310 return searchRoot;
1311 } 1311 }
1312 1312
1313 GraphicsLayer* layerForScrolling = searchRoot->scrollableArea() ? searchRoot ->scrollableArea()->layerForScrolling() : 0; 1313 GraphicsLayer* layerForScrolling = searchRoot->scrollableArea() ? searchRoot ->scrollableArea()->layerForScrolling() : 0;
1314 if (graphicsLayer == layerForScrolling) { 1314 if (graphicsLayer == layerForScrolling) {
1315 *layerType = "scrolling"; 1315 *layerType = "scrolling";
1316 return searchRoot; 1316 return searchRoot;
1317 } 1317 }
1318 1318
1319 if (searchRoot->compositingState() == PaintsIntoGroupedBacking) { 1319 if (searchRoot->compositingState() == PaintsIntoGroupedBacking) {
1320 GraphicsLayer* squashingLayer = searchRoot->groupedMapping()->squashingL ayer(); 1320 GraphicsLayer* squashingLayer = searchRoot->groupedMapping()->squashingL ayer();
1321 if (graphicsLayer == squashingLayer) { 1321 if (graphicsLayer == squashingLayer) {
1322 *layerType ="squashing"; 1322 *layerType ="squashing";
1323 *layerOffset = -searchRoot->offsetFromSquashingLayerOrigin(); 1323 LayoutRect rect;
1324 RenderLayer::mapRectToPaintBackingCoordinates(searchRoot->renderer() , rect);
1325 *layerOffset = IntSize(rect.x(), rect.y());
1324 return searchRoot; 1326 return searchRoot;
1325 } 1327 }
1326 } 1328 }
1327 1329
1328 GraphicsLayer* layerForHorizontalScrollbar = searchRoot->scrollableArea() ? searchRoot->scrollableArea()->layerForHorizontalScrollbar() : 0; 1330 GraphicsLayer* layerForHorizontalScrollbar = searchRoot->scrollableArea() ? searchRoot->scrollableArea()->layerForHorizontalScrollbar() : 0;
1329 if (graphicsLayer == layerForHorizontalScrollbar) { 1331 if (graphicsLayer == layerForHorizontalScrollbar) {
1330 *layerType = "horizontalScrollbar"; 1332 *layerType = "horizontalScrollbar";
1331 return searchRoot; 1333 return searchRoot;
1332 } 1334 }
1333 1335
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
2334 } 2336 }
2335 networkStateNotifier().setWebConnectionTypeForTest(webtype); 2337 networkStateNotifier().setWebConnectionTypeForTest(webtype);
2336 } 2338 }
2337 2339
2338 unsigned Internals::countHitRegions(CanvasRenderingContext2D* context) 2340 unsigned Internals::countHitRegions(CanvasRenderingContext2D* context)
2339 { 2341 {
2340 return context->hitRegionsCount(); 2342 return context->hitRegionsCount();
2341 } 2343 }
2342 2344
2343 } // namespace WebCore 2345 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/compositing/CompositedLayerMapping.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698