| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #include "public/platform/WebCompositorSupport.h" | 49 #include "public/platform/WebCompositorSupport.h" |
| 50 #include "public/platform/WebContentLayer.h" | 50 #include "public/platform/WebContentLayer.h" |
| 51 #include "public/platform/WebDisplayItemList.h" | 51 #include "public/platform/WebDisplayItemList.h" |
| 52 #include "public/platform/WebFloatPoint.h" | 52 #include "public/platform/WebFloatPoint.h" |
| 53 #include "public/platform/WebLayer.h" | 53 #include "public/platform/WebLayer.h" |
| 54 #include "public/platform/WebRect.h" | 54 #include "public/platform/WebRect.h" |
| 55 #include "public/platform/WebSize.h" | 55 #include "public/platform/WebSize.h" |
| 56 #include "public/web/WebKit.h" | 56 #include "public/web/WebKit.h" |
| 57 #include "third_party/skia/include/core/SkCanvas.h" | 57 #include "third_party/skia/include/core/SkCanvas.h" |
| 58 #include "third_party/skia/include/core/SkMatrix44.h" | 58 #include "third_party/skia/include/core/SkMatrix44.h" |
| 59 #include "third_party/skia/include/core/SkPictureRecorder.h" | 59 #include "skia/ext/cdl_picture_recorder.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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 return gfx::Rect(0, 0, contentLayer()->layer()->bounds().width, | 310 return gfx::Rect(0, 0, contentLayer()->layer()->bounds().width, |
| 311 contentLayer()->layer()->bounds().height); | 311 contentLayer()->layer()->bounds().height); |
| 312 } | 312 } |
| 313 | 313 |
| 314 void LinkHighlightImpl::paintContents( | 314 void LinkHighlightImpl::paintContents( |
| 315 WebDisplayItemList* webDisplayItemList, | 315 WebDisplayItemList* webDisplayItemList, |
| 316 WebContentLayerClient::PaintingControlSetting paintingControl) { | 316 WebContentLayerClient::PaintingControlSetting paintingControl) { |
| 317 if (!m_node || !m_node->layoutObject()) | 317 if (!m_node || !m_node->layoutObject()) |
| 318 return; | 318 return; |
| 319 | 319 |
| 320 SkPictureRecorder recorder; | 320 CdlPictureRecorder recorder; |
| 321 gfx::Rect visualRect = paintableRegion(); | 321 gfx::Rect visualRect = paintableRegion(); |
| 322 SkCanvas* canvas = | 322 CdlCanvas* canvas = |
| 323 recorder.beginRecording(visualRect.width(), visualRect.height()); | 323 recorder.beginRecording(visualRect.width(), visualRect.height()); |
| 324 | 324 |
| 325 SkPaint paint; | 325 CdlPaint paint; |
| 326 paint.setStyle(SkPaint::kFill_Style); | 326 paint.setStyle(CdlPaint::kFill_Style); |
| 327 paint.setFlags(SkPaint::kAntiAlias_Flag); | 327 paint.setAntiAlias(true); |
| 328 paint.setColor(m_node->layoutObject()->style()->tapHighlightColor().rgb()); | 328 paint.setColor(m_node->layoutObject()->style()->tapHighlightColor().rgb()); |
| 329 canvas->drawPath(m_path.getSkPath(), paint); | 329 canvas->drawPath(m_path.getSkPath(), paint); |
| 330 | 330 |
| 331 webDisplayItemList->appendDrawingItem( | 331 webDisplayItemList->appendDrawingItem( |
| 332 WebRect(visualRect.x(), visualRect.y(), visualRect.width(), | 332 WebRect(visualRect.x(), visualRect.y(), visualRect.width(), |
| 333 visualRect.height()), | 333 visualRect.height()), |
| 334 recorder.finishRecordingAsPicture()); | 334 recorder.finishRecordingAsPicture()); |
| 335 } | 335 } |
| 336 | 336 |
| 337 void LinkHighlightImpl::startHighlightAnimationIfNeeded() { | 337 void LinkHighlightImpl::startHighlightAnimationIfNeeded() { |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 | 443 |
| 444 WebLayer* LinkHighlightImpl::layer() { | 444 WebLayer* LinkHighlightImpl::layer() { |
| 445 return clipLayer(); | 445 return clipLayer(); |
| 446 } | 446 } |
| 447 | 447 |
| 448 CompositorAnimationPlayer* LinkHighlightImpl::compositorPlayer() const { | 448 CompositorAnimationPlayer* LinkHighlightImpl::compositorPlayer() const { |
| 449 return m_compositorPlayer.get(); | 449 return m_compositorPlayer.get(); |
| 450 } | 450 } |
| 451 | 451 |
| 452 } // namespace blink | 452 } // namespace blink |
| OLD | NEW |