Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2013 Apple Inc. All rights reserv ed. | 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2013 Apple Inc. All rights reserv ed. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 */ | 22 */ |
| 23 | 23 |
| 24 #include "core/style/NinePieceImage.h" | 24 #include "core/style/NinePieceImage.h" |
| 25 | 25 |
| 26 #include "core/style/DataEquivalency.h" | 26 #include "core/style/DataEquivalency.h" |
| 27 | 27 |
| 28 namespace blink { | 28 namespace blink { |
| 29 | 29 |
| 30 static DataRef<NinePieceImageData>& defaultData() | 30 static DataRef<NinePieceImageData>& defaultData() |
| 31 { | 31 { |
| 32 static DataRef<NinePieceImageData>* data = new DataRef<NinePieceImageData>; | 32 DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<DataRef<NinePieceImageData>>, data, |
| 33 if (!data->get()) | 33 new ThreadSpecific<DataRef<NinePieceImageData>>); |
|
esprehn
2016/09/12 20:53:12
ditto
| |
| 34 if (!data->get()) { | |
| 34 data->init(); | 35 data->init(); |
| 36 } | |
| 35 return *data; | 37 return *data; |
| 36 } | 38 } |
| 37 | 39 |
| 38 NinePieceImage::NinePieceImage() | 40 NinePieceImage::NinePieceImage() |
| 39 : m_data(defaultData()) | 41 : m_data(defaultData()) |
| 40 { | 42 { |
| 41 } | 43 } |
| 42 | 44 |
| 43 NinePieceImage::NinePieceImage(StyleImage* image, LengthBox imageSlices, bool fi ll, const BorderImageLengthBox& borderSlices, const BorderImageLengthBox& outset , ENinePieceImageRule horizontalRule, ENinePieceImageRule verticalRule) | 45 NinePieceImage::NinePieceImage(StyleImage* image, LengthBox imageSlices, bool fi ll, const BorderImageLengthBox& borderSlices, const BorderImageLengthBox& outset , ENinePieceImageRule horizontalRule, ENinePieceImageRule verticalRule) |
| 44 { | 46 { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 return dataEquivalent(image, other.image) | 82 return dataEquivalent(image, other.image) |
| 81 && imageSlices == other.imageSlices | 83 && imageSlices == other.imageSlices |
| 82 && fill == other.fill | 84 && fill == other.fill |
| 83 && borderSlices == other.borderSlices | 85 && borderSlices == other.borderSlices |
| 84 && outset == other.outset | 86 && outset == other.outset |
| 85 && horizontalRule == other.horizontalRule | 87 && horizontalRule == other.horizontalRule |
| 86 && verticalRule == other.verticalRule; | 88 && verticalRule == other.verticalRule; |
| 87 } | 89 } |
| 88 | 90 |
| 89 } // namespace blink | 91 } // namespace blink |
| OLD | NEW |