| 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 NinePieceImageGrid_h | 5 #ifndef NinePieceImageGrid_h |
| 6 #define NinePieceImageGrid_h | 6 #define NinePieceImageGrid_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" |
| 8 #include "platform/geometry/FloatRect.h" | 9 #include "platform/geometry/FloatRect.h" |
| 9 #include "platform/geometry/FloatSize.h" | 10 #include "platform/geometry/FloatSize.h" |
| 10 #include "platform/geometry/IntRect.h" | 11 #include "platform/geometry/IntRect.h" |
| 11 #include "platform/geometry/IntSize.h" | 12 #include "platform/geometry/IntSize.h" |
| 12 #include "platform/graphics/Image.h" | 13 #include "platform/graphics/Image.h" |
| 13 #include "platform/heap/Heap.h" | 14 #include "platform/heap/Heap.h" |
| 14 | 15 |
| 15 namespace blink { | 16 namespace blink { |
| 16 | 17 |
| 17 class IntRectOutsets; | 18 class IntRectOutsets; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 // | | | | | | | | | 51 // | | | | | | | | |
| 51 // | 3 | 9 | 6 | | | css | | | 52 // | 3 | 9 | 6 | | | css | | |
| 52 // | | image | | | | box | | | 53 // | | image | | | | box | | |
| 53 // | | | | | | | | | 54 // | | | | | | | | |
| 54 // --+---+---------+---+--- | | | | | 55 // --+---+---------+---+--- | | | | |
| 55 // | 2 | 8 | 5 | | +------------+ | | 56 // | 2 | 8 | 5 | | +------------+ | |
| 56 // +---+---------+---+ | | | 57 // +---+---------+---+ | | |
| 57 // | | +------------------+ | 58 // | | +------------------+ |
| 58 // | 59 // |
| 59 // it generates drawing information for the nine border pieces. | 60 // it generates drawing information for the nine border pieces. |
| 60 class NinePieceImageGrid { | 61 class CORE_EXPORT NinePieceImageGrid { |
| 61 STACK_ALLOCATED(); | 62 STACK_ALLOCATED(); |
| 62 | 63 |
| 63 public: | 64 public: |
| 64 NinePieceImageGrid(const NinePieceImage&, IntSize imageSize, IntRect borderI
mageArea, | 65 NinePieceImageGrid(const NinePieceImage&, IntSize imageSize, IntRect borderI
mageArea, |
| 65 const IntRectOutsets& borderWidths); | 66 const IntRectOutsets& borderWidths); |
| 66 | 67 |
| 67 struct NinePieceDrawInfo { | 68 struct CORE_EXPORT NinePieceDrawInfo { |
| 68 bool isDrawable; | 69 bool isDrawable; |
| 69 bool isCornerPiece; | 70 bool isCornerPiece; |
| 70 FloatRect destination; | 71 FloatRect destination; |
| 71 FloatRect source; | 72 FloatRect source; |
| 72 | 73 |
| 73 // tileScale and tileRule are only useful for non-corners, i.e. edge and
center pieces. | 74 // tileScale and tileRule are only useful for non-corners, i.e. edge and
center pieces. |
| 74 FloatSize tileScale; | 75 FloatSize tileScale; |
| 75 struct { | 76 struct { |
| 76 Image::TileRule horizontal; | 77 Image::TileRule horizontal; |
| 77 Image::TileRule vertical; | 78 Image::TileRule vertical; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 99 | 100 |
| 100 Edge m_top; | 101 Edge m_top; |
| 101 Edge m_right; | 102 Edge m_right; |
| 102 Edge m_bottom; | 103 Edge m_bottom; |
| 103 Edge m_left; | 104 Edge m_left; |
| 104 }; | 105 }; |
| 105 | 106 |
| 106 } // namespace blink | 107 } // namespace blink |
| 107 | 108 |
| 108 #endif // NinePieceImageGrid_h | 109 #endif // NinePieceImageGrid_h |
| OLD | NEW |