| OLD | NEW |
| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 m_contentLayer->layer()->setPosition(boundingRect.location()); | 259 m_contentLayer->layer()->setPosition(boundingRect.location()); |
| 260 | 260 |
| 261 return pathHasChanged; | 261 return pathHasChanged; |
| 262 } | 262 } |
| 263 | 263 |
| 264 gfx::Rect LinkHighlightImpl::paintableRegion() | 264 gfx::Rect LinkHighlightImpl::paintableRegion() |
| 265 { | 265 { |
| 266 return gfx::Rect(0, 0, contentLayer()->layer()->bounds().width, contentLayer
()->layer()->bounds().height); | 266 return gfx::Rect(0, 0, contentLayer()->layer()->bounds().width, contentLayer
()->layer()->bounds().height); |
| 267 } | 267 } |
| 268 | 268 |
| 269 void LinkHighlightImpl::paintContents(WebDisplayItemList* webDisplayItemList, co
nst WebRect& webClipRect, WebContentLayerClient::PaintingControlSetting painting
Control) | 269 void LinkHighlightImpl::paintContents(WebDisplayItemList* webDisplayItemList, We
bContentLayerClient::PaintingControlSetting paintingControl) |
| 270 { | 270 { |
| 271 if (!m_node || !m_node->layoutObject()) | 271 if (!m_node || !m_node->layoutObject()) |
| 272 return; | 272 return; |
| 273 | 273 |
| 274 SkPictureRecorder recorder; | 274 SkPictureRecorder recorder; |
| 275 SkCanvas* canvas = recorder.beginRecording(webClipRect.width, webClipRect.he
ight); | 275 SkCanvas* canvas = recorder.beginRecording(paintableRegion().width(), painta
bleRegion().height()); |
| 276 canvas->translate(-webClipRect.x, -webClipRect.y); | |
| 277 | 276 |
| 278 SkPaint paint; | 277 SkPaint paint; |
| 279 paint.setStyle(SkPaint::kFill_Style); | 278 paint.setStyle(SkPaint::kFill_Style); |
| 280 paint.setFlags(SkPaint::kAntiAlias_Flag); | 279 paint.setFlags(SkPaint::kAntiAlias_Flag); |
| 281 paint.setColor(m_node->layoutObject()->style()->tapHighlightColor().rgb()); | 280 paint.setColor(m_node->layoutObject()->style()->tapHighlightColor().rgb()); |
| 282 canvas->drawPath(m_path.skPath(), paint); | 281 canvas->drawPath(m_path.skPath(), paint); |
| 283 | 282 |
| 284 RefPtr<const SkPicture> picture = adoptRef(recorder.endRecording()); | 283 RefPtr<const SkPicture> picture = adoptRef(recorder.endRecording()); |
| 285 // TODO(wkorman): Pass actual visual rect with the drawing item. | 284 // TODO(wkorman): Pass actual visual rect with the drawing item. |
| 286 webDisplayItemList->appendDrawingItem(IntRect(), picture.get()); | 285 webDisplayItemList->appendDrawingItem(IntRect(), picture.get()); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 { | 384 { |
| 386 return clipLayer(); | 385 return clipLayer(); |
| 387 } | 386 } |
| 388 | 387 |
| 389 WebCompositorAnimationPlayer* LinkHighlightImpl::compositorPlayer() const | 388 WebCompositorAnimationPlayer* LinkHighlightImpl::compositorPlayer() const |
| 390 { | 389 { |
| 391 return m_compositorPlayer.get(); | 390 return m_compositorPlayer.get(); |
| 392 } | 391 } |
| 393 | 392 |
| 394 } // namespace blink | 393 } // namespace blink |
| OLD | NEW |