| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/paint/BoxReflectionUtils.h" | 5 #include "core/paint/BoxReflectionUtils.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutBox.h" | 7 #include "core/layout/LayoutBox.h" |
| 8 #include "core/paint/NinePieceImagePainter.h" | 8 #include "core/paint/NinePieceImagePainter.h" |
| 9 #include "core/paint/PaintLayer.h" | 9 #include "core/paint/PaintLayer.h" |
| 10 #include "platform/LengthFunctions.h" | 10 #include "platform/LengthFunctions.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 LayoutRect maskBoundingRect(maskRect); | 51 LayoutRect maskBoundingRect(maskRect); |
| 52 maskBoundingRect.expand(style.imageOutsets(maskNinePiece)); | 52 maskBoundingRect.expand(style.imageOutsets(maskNinePiece)); |
| 53 FloatRect maskBoundingFloatRect(maskBoundingRect); | 53 FloatRect maskBoundingFloatRect(maskBoundingRect); |
| 54 | 54 |
| 55 // TODO(jbroman): SkPictureBuilder + DrawingRecorder seems excessive. | 55 // TODO(jbroman): SkPictureBuilder + DrawingRecorder seems excessive. |
| 56 // If NinePieceImagePainter operated on SkCanvas, we'd only need an | 56 // If NinePieceImagePainter operated on SkCanvas, we'd only need an |
| 57 // SkPictureRecorder here. | 57 // SkPictureRecorder here. |
| 58 SkPictureBuilder recorder(maskBoundingFloatRect); | 58 SkPictureBuilder recorder(maskBoundingFloatRect); |
| 59 { | 59 { |
| 60 GraphicsContext& context = recorder.context(); | 60 GraphicsContext& context = recorder.context(); |
| 61 DrawingRecorder drawingRecorder(context, *layer.layoutObject(), Disp
layItem::ReflectionMask, maskBoundingFloatRect); | 61 DrawingRecorder drawingRecorder(context, *layer.layoutObject(), Disp
layItem::kReflectionMask, maskBoundingFloatRect); |
| 62 NinePieceImagePainter(*layer.layoutObject()).paint( | 62 NinePieceImagePainter(*layer.layoutObject()).paint( |
| 63 recorder.context(), maskRect, style, maskNinePiece, SkXfermode::
kSrcOver_Mode); | 63 recorder.context(), maskRect, style, maskNinePiece, SkXfermode::
kSrcOver_Mode); |
| 64 } | 64 } |
| 65 mask = recorder.endRecording(); | 65 mask = recorder.endRecording(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 return BoxReflection(direction, offset, mask); | 68 return BoxReflection(direction, offset, mask); |
| 69 } | 69 } |
| 70 | 70 |
| 71 } // namespace blink | 71 } // namespace blink |
| OLD | NEW |