| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef NinePieceImagePainter_h | 5 #ifndef NinePieceImagePainter_h |
| 6 #define NinePieceImagePainter_h | 6 #define NinePieceImagePainter_h |
| 7 | 7 |
| 8 #include "platform/LayoutUnit.h" | |
| 9 #include "platform/heap/Heap.h" | 8 #include "platform/heap/Heap.h" |
| 10 #include "third_party/skia/include/core/SkXfermode.h" | 9 #include "third_party/skia/include/core/SkXfermode.h" |
| 11 | 10 |
| 12 namespace blink { | 11 namespace blink { |
| 13 | 12 |
| 14 class ComputedStyle; | 13 class ComputedStyle; |
| 15 class GraphicsContext; | 14 class GraphicsContext; |
| 16 class LayoutBoxModelObject; | 15 class LayoutBoxModelObject; |
| 17 class LayoutRect; | 16 class LayoutRect; |
| 18 class NinePieceImage; | 17 class NinePieceImage; |
| 19 class BorderImageLength; | |
| 20 | 18 |
| 21 class NinePieceImagePainter { | 19 class NinePieceImagePainter { |
| 22 STACK_ALLOCATED(); | 20 STACK_ALLOCATED(); |
| 23 public: | 21 public: |
| 24 NinePieceImagePainter(LayoutBoxModelObject&); | 22 NinePieceImagePainter(LayoutBoxModelObject&); |
| 25 | 23 |
| 26 bool paint(GraphicsContext*, const LayoutRect&, const ComputedStyle&, const
NinePieceImage&, SkXfermode::Mode) const; | 24 bool paint(GraphicsContext*, const LayoutRect&, const ComputedStyle&, const
NinePieceImage&, SkXfermode::Mode) const; |
| 27 | 25 |
| 28 private: | 26 private: |
| 29 static LayoutUnit computeBorderImageSide(const BorderImageLength& borderSlic
e, LayoutUnit borderSide, LayoutUnit imageSide, LayoutUnit boxExtent); | |
| 30 | |
| 31 LayoutBoxModelObject& m_layoutObject; | 27 LayoutBoxModelObject& m_layoutObject; |
| 32 }; | 28 }; |
| 33 | 29 |
| 34 } // namespace blink | 30 } // namespace blink |
| 35 | 31 |
| 36 #endif // NinePieceImagePainter_h | 32 #endif // NinePieceImagePainter_h |
| OLD | NEW |