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

Side by Side Diff: Source/core/platform/graphics/GraphicsLayer.cpp

Issue 18083034: Don't set scroll client for main frame (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address jamesr review Created 7 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/platform/graphics/GraphicsLayer.h ('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) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 , m_scrollableArea(0) 134 , m_scrollableArea(0)
135 { 135 {
136 #ifndef NDEBUG 136 #ifndef NDEBUG
137 if (m_client) 137 if (m_client)
138 m_client->verifyNotPainting(); 138 m_client->verifyNotPainting();
139 #endif 139 #endif
140 140
141 m_opaqueRectTrackingContentLayerDelegate = adoptPtr(new OpaqueRectTrackingCo ntentLayerDelegate(this)); 141 m_opaqueRectTrackingContentLayerDelegate = adoptPtr(new OpaqueRectTrackingCo ntentLayerDelegate(this));
142 m_layer = adoptPtr(Platform::current()->compositorSupport()->createContentLa yer(m_opaqueRectTrackingContentLayerDelegate.get())); 142 m_layer = adoptPtr(Platform::current()->compositorSupport()->createContentLa yer(m_opaqueRectTrackingContentLayerDelegate.get()));
143 m_layer->layer()->setDrawsContent(m_drawsContent && m_contentsVisible); 143 m_layer->layer()->setDrawsContent(m_drawsContent && m_contentsVisible);
144 m_layer->layer()->setScrollClient(this);
145 m_layer->setAutomaticallyComputeRasterScale(true); 144 m_layer->setAutomaticallyComputeRasterScale(true);
146 } 145 }
147 146
148 GraphicsLayer::~GraphicsLayer() 147 GraphicsLayer::~GraphicsLayer()
149 { 148 {
150 if (m_linkHighlight) { 149 if (m_linkHighlight) {
151 m_linkHighlight->clearCurrentGraphicsLayer(); 150 m_linkHighlight->clearCurrentGraphicsLayer();
152 m_linkHighlight = 0; 151 m_linkHighlight = 0;
153 } 152 }
154 153
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 return; 1328 return;
1330 m_layer->layer()->setBackgroundFilters(*webFilters); 1329 m_layer->layer()->setBackgroundFilters(*webFilters);
1331 } 1330 }
1332 1331
1333 void GraphicsLayer::setLinkHighlight(LinkHighlightClient* linkHighlight) 1332 void GraphicsLayer::setLinkHighlight(LinkHighlightClient* linkHighlight)
1334 { 1333 {
1335 m_linkHighlight = linkHighlight; 1334 m_linkHighlight = linkHighlight;
1336 updateChildList(); 1335 updateChildList();
1337 } 1336 }
1338 1337
1338 void GraphicsLayer::setScrollableArea(ScrollableArea* scrollableArea, bool isMai nFrame)
1339 {
1340 if (m_scrollableArea == scrollableArea)
1341 return;
1342
1343 m_scrollableArea = scrollableArea;
1344
1345 // Main frame scrolling may involve pinch zoom and gets routed through
1346 // WebViewImpl explicitly rather than via GraphicsLayer::didScroll.
1347 if (isMainFrame)
1348 m_layer->layer()->setScrollClient(0);
1349 else
1350 m_layer->layer()->setScrollClient(this);
1351 }
1352
1339 void GraphicsLayer::paint(GraphicsContext& context, const IntRect& clip) 1353 void GraphicsLayer::paint(GraphicsContext& context, const IntRect& clip)
1340 { 1354 {
1341 paintGraphicsLayerContents(context, clip); 1355 paintGraphicsLayerContents(context, clip);
1342 } 1356 }
1343 1357
1344 1358
1345 void GraphicsLayer::notifyAnimationStarted(double startTime) 1359 void GraphicsLayer::notifyAnimationStarted(double startTime)
1346 { 1360 {
1347 if (m_client) 1361 if (m_client)
1348 m_client->notifyAnimationStarted(this, startTime); 1362 m_client->notifyAnimationStarted(this, startTime);
(...skipping 15 matching lines...) Expand all
1364 #ifndef NDEBUG 1378 #ifndef NDEBUG
1365 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer) 1379 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer)
1366 { 1380 {
1367 if (!layer) 1381 if (!layer)
1368 return; 1382 return;
1369 1383
1370 String output = layer->layerTreeAsText(WebCore::LayerTreeIncludesDebugInfo); 1384 String output = layer->layerTreeAsText(WebCore::LayerTreeIncludesDebugInfo);
1371 fprintf(stderr, "%s\n", output.utf8().data()); 1385 fprintf(stderr, "%s\n", output.utf8().data());
1372 } 1386 }
1373 #endif 1387 #endif
OLDNEW
« no previous file with comments | « Source/core/platform/graphics/GraphicsLayer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698