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

Side by Side Diff: third_party/WebKit/Source/web/LinkHighlightImpl.cpp

Issue 1484163002: Raster display item lists via a visual rect RTree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to head. Created 5 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
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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 { 263 {
264 return gfx::Rect(0, 0, contentLayer()->layer()->bounds().width, contentLayer ()->layer()->bounds().height); 264 return gfx::Rect(0, 0, contentLayer()->layer()->bounds().width, contentLayer ()->layer()->bounds().height);
265 } 265 }
266 266
267 void LinkHighlightImpl::paintContents(WebDisplayItemList* webDisplayItemList, We bContentLayerClient::PaintingControlSetting paintingControl) 267 void LinkHighlightImpl::paintContents(WebDisplayItemList* webDisplayItemList, We bContentLayerClient::PaintingControlSetting paintingControl)
268 { 268 {
269 if (!m_node || !m_node->layoutObject()) 269 if (!m_node || !m_node->layoutObject())
270 return; 270 return;
271 271
272 SkPictureRecorder recorder; 272 SkPictureRecorder recorder;
273 SkCanvas* canvas = recorder.beginRecording(paintableRegion().width(), painta bleRegion().height()); 273 gfx::Rect visualRect = paintableRegion();
274 SkCanvas* canvas = recorder.beginRecording(visualRect.width(), visualRect.he ight());
274 275
275 SkPaint paint; 276 SkPaint paint;
276 paint.setStyle(SkPaint::kFill_Style); 277 paint.setStyle(SkPaint::kFill_Style);
277 paint.setFlags(SkPaint::kAntiAlias_Flag); 278 paint.setFlags(SkPaint::kAntiAlias_Flag);
278 paint.setColor(m_node->layoutObject()->style()->tapHighlightColor().rgb()); 279 paint.setColor(m_node->layoutObject()->style()->tapHighlightColor().rgb());
279 canvas->drawPath(m_path.skPath(), paint); 280 canvas->drawPath(m_path.skPath(), paint);
280 281
281 RefPtr<const SkPicture> picture = adoptRef(recorder.endRecording()); 282 RefPtr<const SkPicture> picture = adoptRef(recorder.endRecording());
282 // TODO(wkorman): Pass actual visual rect with the drawing item. 283 // TODO(wkorman): Consider using m_path.skPath().getBounds() as the visual r ect below.
283 webDisplayItemList->appendDrawingItem(IntRect(), picture.get()); 284 webDisplayItemList->appendDrawingItem(WebRect(visualRect.x(), visualRect.y() , visualRect.width(), visualRect.height()), picture.get());
284 } 285 }
285 286
286 void LinkHighlightImpl::startHighlightAnimationIfNeeded() 287 void LinkHighlightImpl::startHighlightAnimationIfNeeded()
287 { 288 {
288 if (m_isAnimating) 289 if (m_isAnimating)
289 return; 290 return;
290 291
291 m_isAnimating = true; 292 m_isAnimating = true;
292 const float startOpacity = 1; 293 const float startOpacity = 1;
293 // FIXME: Should duration be configurable? 294 // FIXME: Should duration be configurable?
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 { 384 {
384 return clipLayer(); 385 return clipLayer();
385 } 386 }
386 387
387 WebCompositorAnimationPlayer* LinkHighlightImpl::compositorPlayer() const 388 WebCompositorAnimationPlayer* LinkHighlightImpl::compositorPlayer() const
388 { 389 {
389 return m_compositorPlayer.get(); 390 return m_compositorPlayer.get();
390 } 391 }
391 392
392 } // namespace blink 393 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698