| 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 27 matching lines...) Expand all Loading... |
| 38 #include "platform/animation/CompositorAnimation.h" | 38 #include "platform/animation/CompositorAnimation.h" |
| 39 #include "platform/animation/CompositorAnimationCurve.h" | 39 #include "platform/animation/CompositorAnimationCurve.h" |
| 40 #include "platform/animation/CompositorFloatAnimationCurve.h" | 40 #include "platform/animation/CompositorFloatAnimationCurve.h" |
| 41 #include "platform/animation/CompositorTargetProperty.h" | 41 #include "platform/animation/CompositorTargetProperty.h" |
| 42 #include "platform/animation/TimingFunction.h" | 42 #include "platform/animation/TimingFunction.h" |
| 43 #include "platform/graphics/Color.h" | 43 #include "platform/graphics/Color.h" |
| 44 #include "platform/graphics/CompositorElementId.h" | 44 #include "platform/graphics/CompositorElementId.h" |
| 45 #include "platform/graphics/CompositorMutableProperties.h" | 45 #include "platform/graphics/CompositorMutableProperties.h" |
| 46 #include "platform/graphics/GraphicsLayer.h" | 46 #include "platform/graphics/GraphicsLayer.h" |
| 47 #include "platform/graphics/paint/DrawingRecorder.h" | 47 #include "platform/graphics/paint/DrawingRecorder.h" |
| 48 #include "platform/graphics/paint/PaintCanvas.h" |
| 49 #include "platform/graphics/paint/PaintRecorder.h" |
| 48 #include "public/platform/Platform.h" | 50 #include "public/platform/Platform.h" |
| 49 #include "public/platform/WebCompositorSupport.h" | 51 #include "public/platform/WebCompositorSupport.h" |
| 50 #include "public/platform/WebContentLayer.h" | 52 #include "public/platform/WebContentLayer.h" |
| 51 #include "public/platform/WebDisplayItemList.h" | 53 #include "public/platform/WebDisplayItemList.h" |
| 52 #include "public/platform/WebFloatPoint.h" | 54 #include "public/platform/WebFloatPoint.h" |
| 53 #include "public/platform/WebLayer.h" | 55 #include "public/platform/WebLayer.h" |
| 54 #include "public/platform/WebRect.h" | 56 #include "public/platform/WebRect.h" |
| 55 #include "public/platform/WebSize.h" | 57 #include "public/platform/WebSize.h" |
| 56 #include "public/web/WebKit.h" | 58 #include "public/web/WebKit.h" |
| 57 #include "third_party/skia/include/core/SkCanvas.h" | |
| 58 #include "third_party/skia/include/core/SkMatrix44.h" | 59 #include "third_party/skia/include/core/SkMatrix44.h" |
| 59 #include "third_party/skia/include/core/SkPictureRecorder.h" | |
| 60 #include "ui/gfx/geometry/rect.h" | 60 #include "ui/gfx/geometry/rect.h" |
| 61 #include "web/WebLocalFrameImpl.h" | 61 #include "web/WebLocalFrameImpl.h" |
| 62 #include "web/WebSettingsImpl.h" | 62 #include "web/WebSettingsImpl.h" |
| 63 #include "web/WebViewImpl.h" | 63 #include "web/WebViewImpl.h" |
| 64 #include "wtf/CurrentTime.h" | 64 #include "wtf/CurrentTime.h" |
| 65 #include "wtf/PtrUtil.h" | 65 #include "wtf/PtrUtil.h" |
| 66 #include "wtf/Vector.h" | 66 #include "wtf/Vector.h" |
| 67 #include <memory> | 67 #include <memory> |
| 68 | 68 |
| 69 namespace blink { | 69 namespace blink { |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 return gfx::Rect(0, 0, contentLayer()->layer()->bounds().width, | 268 return gfx::Rect(0, 0, contentLayer()->layer()->bounds().width, |
| 269 contentLayer()->layer()->bounds().height); | 269 contentLayer()->layer()->bounds().height); |
| 270 } | 270 } |
| 271 | 271 |
| 272 void LinkHighlightImpl::paintContents( | 272 void LinkHighlightImpl::paintContents( |
| 273 WebDisplayItemList* webDisplayItemList, | 273 WebDisplayItemList* webDisplayItemList, |
| 274 WebContentLayerClient::PaintingControlSetting paintingControl) { | 274 WebContentLayerClient::PaintingControlSetting paintingControl) { |
| 275 if (!m_node || !m_node->layoutObject()) | 275 if (!m_node || !m_node->layoutObject()) |
| 276 return; | 276 return; |
| 277 | 277 |
| 278 SkPictureRecorder recorder; | 278 PaintRecorder recorder; |
| 279 gfx::Rect visualRect = paintableRegion(); | 279 gfx::Rect visualRect = paintableRegion(); |
| 280 SkCanvas* canvas = | 280 PaintCanvas* canvas = |
| 281 recorder.beginRecording(visualRect.width(), visualRect.height()); | 281 recorder.beginRecording(visualRect.width(), visualRect.height()); |
| 282 | 282 |
| 283 SkPaint paint; | 283 PaintFlags paint; |
| 284 paint.setStyle(SkPaint::kFill_Style); | 284 paint.setStyle(PaintFlags::kFill_Style); |
| 285 paint.setFlags(SkPaint::kAntiAlias_Flag); | 285 paint.setAntiAlias(true); |
| 286 paint.setColor(m_node->layoutObject()->style()->tapHighlightColor().rgb()); | 286 paint.setColor(m_node->layoutObject()->style()->tapHighlightColor().rgb()); |
| 287 canvas->drawPath(m_path.getSkPath(), paint); | 287 canvas->drawPath(m_path.getSkPath(), paint); |
| 288 | 288 |
| 289 webDisplayItemList->appendDrawingItem( | 289 webDisplayItemList->appendDrawingItem( |
| 290 WebRect(visualRect.x(), visualRect.y(), visualRect.width(), | 290 WebRect(visualRect.x(), visualRect.y(), visualRect.width(), |
| 291 visualRect.height()), | 291 visualRect.height()), |
| 292 recorder.finishRecordingAsPicture()); | 292 recorder.finishRecordingAsPicture()); |
| 293 } | 293 } |
| 294 | 294 |
| 295 void LinkHighlightImpl::startHighlightAnimationIfNeeded() { | 295 void LinkHighlightImpl::startHighlightAnimationIfNeeded() { |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 | 401 |
| 402 WebLayer* LinkHighlightImpl::layer() { | 402 WebLayer* LinkHighlightImpl::layer() { |
| 403 return clipLayer(); | 403 return clipLayer(); |
| 404 } | 404 } |
| 405 | 405 |
| 406 CompositorAnimationPlayer* LinkHighlightImpl::compositorPlayer() const { | 406 CompositorAnimationPlayer* LinkHighlightImpl::compositorPlayer() const { |
| 407 return m_compositorPlayer.get(); | 407 return m_compositorPlayer.get(); |
| 408 } | 408 } |
| 409 | 409 |
| 410 } // namespace blink | 410 } // namespace blink |
| OLD | NEW |