| 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 ContentLayer()->Layer()->Bounds().height); | 271 ContentLayer()->Layer()->Bounds().height); |
| 272 } | 272 } |
| 273 | 273 |
| 274 void LinkHighlightImpl::PaintContents( | 274 void LinkHighlightImpl::PaintContents( |
| 275 WebDisplayItemList* web_display_item_list, | 275 WebDisplayItemList* web_display_item_list, |
| 276 WebContentLayerClient::PaintingControlSetting painting_control) { | 276 WebContentLayerClient::PaintingControlSetting painting_control) { |
| 277 if (!node_ || !node_->GetLayoutObject()) | 277 if (!node_ || !node_->GetLayoutObject()) |
| 278 return; | 278 return; |
| 279 | 279 |
| 280 PaintRecorder recorder; | 280 PaintRecorder recorder; |
| 281 gfx::Rect visual_rect = PaintableRegion(); | 281 gfx::Rect record_bounds = PaintableRegion(); |
| 282 PaintCanvas* canvas = | 282 PaintCanvas* canvas = |
| 283 recorder.beginRecording(visual_rect.width(), visual_rect.height()); | 283 recorder.beginRecording(record_bounds.width(), record_bounds.height()); |
| 284 | 284 |
| 285 PaintFlags flags; | 285 PaintFlags flags; |
| 286 flags.setStyle(PaintFlags::kFill_Style); | 286 flags.setStyle(PaintFlags::kFill_Style); |
| 287 flags.setAntiAlias(true); | 287 flags.setAntiAlias(true); |
| 288 flags.setColor(node_->GetLayoutObject()->Style()->TapHighlightColor().Rgb()); | 288 flags.setColor(node_->GetLayoutObject()->Style()->TapHighlightColor().Rgb()); |
| 289 canvas->drawPath(path_.GetSkPath(), flags); | 289 canvas->drawPath(path_.GetSkPath(), flags); |
| 290 | 290 |
| 291 web_display_item_list->AppendDrawingItem( | 291 web_display_item_list->AppendDrawingItem( |
| 292 WebRect(visual_rect.x(), visual_rect.y(), visual_rect.width(), | 292 WebRect(record_bounds.x(), record_bounds.y(), record_bounds.width(), |
| 293 visual_rect.height()), | 293 record_bounds.height()), |
| 294 recorder.finishRecordingAsPicture()); | 294 recorder.finishRecordingAsPicture(), |
| 295 WebRect(record_bounds.x(), record_bounds.y(), record_bounds.width(), |
| 296 record_bounds.height())); |
| 295 } | 297 } |
| 296 | 298 |
| 297 void LinkHighlightImpl::StartHighlightAnimationIfNeeded() { | 299 void LinkHighlightImpl::StartHighlightAnimationIfNeeded() { |
| 298 if (is_animating_) | 300 if (is_animating_) |
| 299 return; | 301 return; |
| 300 | 302 |
| 301 is_animating_ = true; | 303 is_animating_ = true; |
| 302 const float kStartOpacity = 1; | 304 const float kStartOpacity = 1; |
| 303 // FIXME: Should duration be configurable? | 305 // FIXME: Should duration be configurable? |
| 304 const float kFadeDuration = 0.1f; | 306 const float kFadeDuration = 0.1f; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 | 407 |
| 406 WebLayer* LinkHighlightImpl::Layer() { | 408 WebLayer* LinkHighlightImpl::Layer() { |
| 407 return ClipLayer(); | 409 return ClipLayer(); |
| 408 } | 410 } |
| 409 | 411 |
| 410 CompositorAnimationPlayer* LinkHighlightImpl::CompositorPlayer() const { | 412 CompositorAnimationPlayer* LinkHighlightImpl::CompositorPlayer() const { |
| 411 return compositor_player_.get(); | 413 return compositor_player_.get(); |
| 412 } | 414 } |
| 413 | 415 |
| 414 } // namespace blink | 416 } // namespace blink |
| OLD | NEW |