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

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

Issue 354223002: Add methods to RenderLayer to get at the painting or scrolling graphics layers, if present. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Edited comments. 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/RenderLayer.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 * 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 RenderLayer* renderLayer; 115 RenderLayer* renderLayer;
116 do { 116 do {
117 renderLayer = renderer->enclosingLayer()->enclosingCompositingLayerForPa intInvalidation(); 117 renderLayer = renderer->enclosingLayer()->enclosingCompositingLayerForPa intInvalidation();
118 if (!renderLayer) { 118 if (!renderLayer) {
119 renderer = renderer->frame()->ownerRenderer(); 119 renderer = renderer->frame()->ownerRenderer();
120 if (!renderer) 120 if (!renderer)
121 return 0; 121 return 0;
122 } 122 }
123 } while (!renderLayer); 123 } while (!renderLayer);
124 124
125 CompositedLayerMappingPtr compositedLayerMapping = renderLayer->compositingS tate() == PaintsIntoGroupedBacking ? renderLayer->groupedMapping() : renderLayer ->compositedLayerMapping(); 125 ASSERT(renderLayer->compositingState() != NotComposited);
126 GraphicsLayer* newGraphicsLayer = renderLayer->compositingState() == PaintsI ntoGroupedBacking ? compositedLayerMapping->squashingLayer() : compositedLayerMa pping->mainGraphicsLayer(); 126
127 GraphicsLayer* newGraphicsLayer = renderLayer->graphicsLayerBacking();
128 if (!newGraphicsLayer->drawsContent()) {
129 newGraphicsLayer = renderLayer->graphicsLayerBackingForScrolling();
130 }
127 131
128 m_clipLayer->setTransform(SkMatrix44(SkMatrix44::kIdentity_Constructor)); 132 m_clipLayer->setTransform(SkMatrix44(SkMatrix44::kIdentity_Constructor));
129 133
130 if (!newGraphicsLayer->drawsContent()) {
131 if (renderLayer->scrollableArea() && renderLayer->scrollableArea()->uses CompositedScrolling()) {
132 ASSERT(renderLayer->hasCompositedLayerMapping() && renderLayer->comp ositedLayerMapping()->scrollingContentsLayer());
133 newGraphicsLayer = compositedLayerMapping->scrollingContentsLayer();
134 }
135 }
136
137 if (m_currentGraphicsLayer != newGraphicsLayer) { 134 if (m_currentGraphicsLayer != newGraphicsLayer) {
138 if (m_currentGraphicsLayer) 135 if (m_currentGraphicsLayer)
139 clearGraphicsLayerLinkHighlightPointer(); 136 clearGraphicsLayerLinkHighlightPointer();
140 137
141 m_currentGraphicsLayer = newGraphicsLayer; 138 m_currentGraphicsLayer = newGraphicsLayer;
142 m_currentGraphicsLayer->addLinkHighlight(this); 139 m_currentGraphicsLayer->addLinkHighlight(this);
143 } 140 }
144 141
145 return renderLayer; 142 return renderLayer;
146 } 143 }
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 // Make sure we update geometry on the next callback from WebViewImpl::layou t(). 351 // Make sure we update geometry on the next callback from WebViewImpl::layou t().
355 m_geometryNeedsUpdate = true; 352 m_geometryNeedsUpdate = true;
356 } 353 }
357 354
358 WebLayer* LinkHighlight::layer() 355 WebLayer* LinkHighlight::layer()
359 { 356 {
360 return clipLayer(); 357 return clipLayer();
361 } 358 }
362 359
363 } // namespace WeKit 360 } // namespace WeKit
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698