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 record_bounds = PaintableRegion(); | 281 gfx::Rect visual_rect = PaintableRegion(); |
282 PaintCanvas* canvas = | 282 PaintCanvas* canvas = |
283 recorder.beginRecording(record_bounds.width(), record_bounds.height()); | 283 recorder.beginRecording(visual_rect.width(), visual_rect.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(record_bounds.x(), record_bounds.y(), record_bounds.width(), | 292 WebRect(visual_rect.x(), visual_rect.y(), visual_rect.width(), |
293 record_bounds.height()), | 293 visual_rect.height()), |
294 recorder.finishRecordingAsPicture(), | 294 recorder.finishRecordingAsPicture()); |
295 WebRect(record_bounds.x(), record_bounds.y(), record_bounds.width(), | |
296 record_bounds.height())); | |
297 } | 295 } |
298 | 296 |
299 void LinkHighlightImpl::StartHighlightAnimationIfNeeded() { | 297 void LinkHighlightImpl::StartHighlightAnimationIfNeeded() { |
300 if (is_animating_) | 298 if (is_animating_) |
301 return; | 299 return; |
302 | 300 |
303 is_animating_ = true; | 301 is_animating_ = true; |
304 const float kStartOpacity = 1; | 302 const float kStartOpacity = 1; |
305 // FIXME: Should duration be configurable? | 303 // FIXME: Should duration be configurable? |
306 const float kFadeDuration = 0.1f; | 304 const float kFadeDuration = 0.1f; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 | 405 |
408 WebLayer* LinkHighlightImpl::Layer() { | 406 WebLayer* LinkHighlightImpl::Layer() { |
409 return ClipLayer(); | 407 return ClipLayer(); |
410 } | 408 } |
411 | 409 |
412 CompositorAnimationPlayer* LinkHighlightImpl::CompositorPlayer() const { | 410 CompositorAnimationPlayer* LinkHighlightImpl::CompositorPlayer() const { |
413 return compositor_player_.get(); | 411 return compositor_player_.get(); |
414 } | 412 } |
415 | 413 |
416 } // namespace blink | 414 } // namespace blink |
OLD | NEW |