| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2013 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 DescriptorParsingResult() | 50 DescriptorParsingResult() |
| 51 : m_density(UninitializedDescriptor), | 51 : m_density(UninitializedDescriptor), |
| 52 m_resourceWidth(UninitializedDescriptor), | 52 m_resourceWidth(UninitializedDescriptor), |
| 53 m_resourceHeight(UninitializedDescriptor) {} | 53 m_resourceHeight(UninitializedDescriptor) {} |
| 54 | 54 |
| 55 bool hasDensity() const { return m_density >= 0; } | 55 bool hasDensity() const { return m_density >= 0; } |
| 56 bool hasWidth() const { return m_resourceWidth >= 0; } | 56 bool hasWidth() const { return m_resourceWidth >= 0; } |
| 57 bool hasHeight() const { return m_resourceHeight >= 0; } | 57 bool hasHeight() const { return m_resourceHeight >= 0; } |
| 58 | 58 |
| 59 float density() const { | 59 float density() const { |
| 60 ASSERT(hasDensity()); | 60 DCHECK(hasDensity()); |
| 61 return m_density; | 61 return m_density; |
| 62 } | 62 } |
| 63 unsigned getResourceWidth() const { | 63 unsigned getResourceWidth() const { |
| 64 ASSERT(hasWidth()); | 64 DCHECK(hasWidth()); |
| 65 return m_resourceWidth; | 65 return m_resourceWidth; |
| 66 } | 66 } |
| 67 unsigned resourceHeight() const { | 67 unsigned resourceHeight() const { |
| 68 ASSERT(hasHeight()); | 68 DCHECK(hasHeight()); |
| 69 return m_resourceHeight; | 69 return m_resourceHeight; |
| 70 } | 70 } |
| 71 | 71 |
| 72 void setResourceWidth(int width) { | 72 void setResourceWidth(int width) { |
| 73 ASSERT(width >= 0); | 73 DCHECK_GE(width, 0); |
| 74 m_resourceWidth = (unsigned)width; | 74 m_resourceWidth = (unsigned)width; |
| 75 } | 75 } |
| 76 void setResourceHeight(int height) { | 76 void setResourceHeight(int height) { |
| 77 ASSERT(height >= 0); | 77 DCHECK_GE(height, 0); |
| 78 m_resourceHeight = (unsigned)height; | 78 m_resourceHeight = (unsigned)height; |
| 79 } | 79 } |
| 80 void setDensity(float densityToSet) { | 80 void setDensity(float densityToSet) { |
| 81 ASSERT(densityToSet >= 0); | 81 DCHECK_GE(densityToSet, 0); |
| 82 m_density = densityToSet; | 82 m_density = densityToSet; |
| 83 } | 83 } |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 float m_density; | 86 float m_density; |
| 87 int m_resourceWidth; | 87 int m_resourceWidth; |
| 88 int m_resourceHeight; | 88 int m_resourceHeight; |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 class ImageCandidate { | 91 class ImageCandidate { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 Document* = nullptr); | 147 Document* = nullptr); |
| 148 | 148 |
| 149 String bestFitSourceForImageAttributes(float deviceScaleFactor, | 149 String bestFitSourceForImageAttributes(float deviceScaleFactor, |
| 150 float sourceSize, | 150 float sourceSize, |
| 151 const String& srcAttribute, | 151 const String& srcAttribute, |
| 152 ImageCandidate& srcsetImageCandidate); | 152 ImageCandidate& srcsetImageCandidate); |
| 153 | 153 |
| 154 } // namespace blink | 154 } // namespace blink |
| 155 | 155 |
| 156 #endif | 156 #endif |
| OLD | NEW |