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

Side by Side Diff: sky/engine/web/LinkHighlight.cpp

Issue 763013002: Get rid of the remaining uses of GraphicsLayer. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix diff Created 6 years 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
« no previous file with comments | « sky/engine/web/ChromeClientImpl.cpp ('k') | sky/engine/web/WebViewImpl.h » ('j') | 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 return m_clipLayer.get(); 97 return m_clipLayer.get();
98 } 98 }
99 99
100 void LinkHighlight::releaseResources() 100 void LinkHighlight::releaseResources()
101 { 101 {
102 m_node.clear(); 102 m_node.clear();
103 } 103 }
104 104
105 RenderLayer* LinkHighlight::computeEnclosingCompositingLayer() 105 RenderLayer* LinkHighlight::computeEnclosingCompositingLayer()
106 { 106 {
107 if (!m_node || !m_node->renderer()) 107 return 0;
108 return 0;
109
110 // Find the nearest enclosing composited layer and attach to it. We may need to cross frame boundaries
111 // to find a suitable layer.
112 RenderObject* renderer = m_node->renderer();
113 RenderLayer* renderLayer = renderer->enclosingLayer()->enclosingLayerForPain tInvalidation();
114
115 GraphicsLayer* newGraphicsLayer = renderLayer->graphicsLayerBacking();
116
117 m_clipLayer->setTransform(SkMatrix44(SkMatrix44::kIdentity_Constructor));
118
119 if (m_currentGraphicsLayer != newGraphicsLayer) {
120 if (m_currentGraphicsLayer)
121 clearGraphicsLayerLinkHighlightPointer();
122
123 m_currentGraphicsLayer = newGraphicsLayer;
124 m_currentGraphicsLayer->addLinkHighlight(this);
125 }
126
127 return renderLayer;
128 } 108 }
129 109
130 static void convertTargetSpaceQuadToCompositedLayer(const FloatQuad& targetSpace Quad, RenderObject* targetRenderer, RenderObject* compositedRenderer, FloatQuad& compositedSpaceQuad) 110 static void convertTargetSpaceQuadToCompositedLayer(const FloatQuad& targetSpace Quad, RenderObject* targetRenderer, RenderObject* compositedRenderer, FloatQuad& compositedSpaceQuad)
131 { 111 {
132 ASSERT(targetRenderer); 112 ASSERT(targetRenderer);
133 ASSERT(compositedRenderer); 113 ASSERT(compositedRenderer);
134 114
135 for (unsigned i = 0; i < 4; ++i) { 115 for (unsigned i = 0; i < 4; ++i) {
136 IntPoint point; 116 IntPoint point;
137 switch (i) { 117 switch (i) {
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 // Make sure we update geometry on the next callback from WebViewImpl::layou t(). 311 // Make sure we update geometry on the next callback from WebViewImpl::layou t().
332 m_geometryNeedsUpdate = true; 312 m_geometryNeedsUpdate = true;
333 } 313 }
334 314
335 WebLayer* LinkHighlight::layer() 315 WebLayer* LinkHighlight::layer()
336 { 316 {
337 return clipLayer(); 317 return clipLayer();
338 } 318 }
339 319
340 } // namespace blink 320 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/web/ChromeClientImpl.cpp ('k') | sky/engine/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698