| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 } | 73 } |
| 74 GraphicsLayer* containerLayer() | 74 GraphicsLayer* containerLayer() |
| 75 { | 75 { |
| 76 return m_innerViewportContainerLayer.get(); | 76 return m_innerViewportContainerLayer.get(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 // Sets the location of the inner viewport relative to the outer viewport. T
he | 79 // Sets the location of the inner viewport relative to the outer viewport. T
he |
| 80 // coordinates are in partial CSS pixels. | 80 // coordinates are in partial CSS pixels. |
| 81 void setLocation(const FloatPoint&); | 81 void setLocation(const FloatPoint&); |
| 82 void move(const FloatPoint&); | 82 void move(const FloatPoint&); |
| 83 FloatPoint location() const { return m_offset; } // used in unit tests |
| 83 | 84 |
| 84 // Sets the size of the inner viewport when unscaled in CSS pixels. | 85 // Sets the size of the inner viewport when unscaled in CSS pixels. |
| 85 // This will be clamped to the size of the outer viewport (the main frame). | 86 // This will be clamped to the size of the outer viewport (the main frame). |
| 86 void setSize(const IntSize&); | 87 void setSize(const IntSize&); |
| 87 IntSize size() const { return m_size; } | 88 IntSize size() const { return m_size; } |
| 88 | 89 |
| 89 // Resets the viewport to initial state. | 90 // Resets the viewport to initial state. |
| 90 void reset(); | 91 void reset(); |
| 91 | 92 |
| 92 // Let the viewport know that the main frame changed size (either through sc
reen | 93 // Let the viewport know that the main frame changed size (either through sc
reen |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 157 |
| 157 // Offset of the pinch viewport from the main frame's origin, in CSS pixels. | 158 // Offset of the pinch viewport from the main frame's origin, in CSS pixels. |
| 158 FloatPoint m_offset; | 159 FloatPoint m_offset; |
| 159 float m_scale; | 160 float m_scale; |
| 160 IntSize m_size; | 161 IntSize m_size; |
| 161 }; | 162 }; |
| 162 | 163 |
| 163 } // namespace blink | 164 } // namespace blink |
| 164 | 165 |
| 165 #endif // PinchViewport_h | 166 #endif // PinchViewport_h |
| OLD | NEW |