| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 18 matching lines...) Expand all Loading... |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WebFrameTime_h | 31 #ifndef WebFrameTime_h |
| 32 #define WebFrameTime_h | 32 #define WebFrameTime_h |
| 33 | 33 |
| 34 #include "WebCommon.h" | 34 #include "WebCommon.h" |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 struct WebFrameTime { | 38 struct WebFrameTime { |
| 39 const static int64_t Undefined = -1; |
| 40 |
| 41 WebFrameTime() |
| 42 : lastFrameTime(Undefined) |
| 43 , renderDeadline(Undefined) |
| 44 , displayFrameTime(Undefined) |
| 45 , predictedNextDisplayFrameTime(Undefined) |
| 46 { } |
| 47 |
| 39 WebFrameTime(double lastFrameTime, double renderDeadline, double displayFram
eTime, double predictedNextDisplayFrameTime) | 48 WebFrameTime(double lastFrameTime, double renderDeadline, double displayFram
eTime, double predictedNextDisplayFrameTime) |
| 40 : lastFrameTime(lastFrameTime) | 49 : lastFrameTime(lastFrameTime) |
| 41 , renderDeadline(renderDeadline) | 50 , renderDeadline(renderDeadline) |
| 42 , displayFrameTime(displayFrameTime) | 51 , displayFrameTime(displayFrameTime) |
| 43 , predictedNextDisplayFrameTime(predictedNextDisplayFrameTime) | 52 , predictedNextDisplayFrameTime(predictedNextDisplayFrameTime) |
| 44 { } | 53 { } |
| 45 | 54 |
| 55 bool isNull() const |
| 56 { |
| 57 return ( |
| 58 lastFrameTime == Undefined |
| 59 && renderDeadline == Undefined |
| 60 && displayFrameTime == Undefined |
| 61 && predictedNextDisplayFrameTime == Undefined); |
| 62 } |
| 63 |
| 46 // FIXME(mithro): Upgrade the time in CLOCK_MONOTONIC values to use a | 64 // FIXME(mithro): Upgrade the time in CLOCK_MONOTONIC values to use a |
| 47 // TimeTick like class rather than a bare double. | 65 // TimeTick like class rather than a bare double. |
| 48 | 66 |
| 49 // Time in CLOCK_MONOTONIC that is the most recent vsync time. | 67 // Time in CLOCK_MONOTONIC that is the most recent vsync time. |
| 50 double lastFrameTime; | 68 double lastFrameTime; |
| 51 | 69 |
| 52 // Time in CLOCK_MONOTONIC by which rendering must be finished by to not | 70 // Time in CLOCK_MONOTONIC by which rendering must be finished by to not |
| 53 // stall the pipeline. | 71 // stall the pipeline. |
| 54 double renderDeadline; | 72 double renderDeadline; |
| 55 | 73 |
| 56 // Time in CLOCK_MONOTONIC that the frame will hit the glass of the display | 74 // Time in CLOCK_MONOTONIC that the frame will hit the glass of the display |
| 57 // if rendered within the deadline. This time may be identical to | 75 // if rendered within the deadline. This time may be identical to |
| 58 // lastFrameTime. | 76 // lastFrameTime. |
| 59 double displayFrameTime; | 77 double displayFrameTime; |
| 60 | 78 |
| 61 // Time in CLOCK_MONOTONIC that is the predicated next value for | 79 // Time in CLOCK_MONOTONIC that is the predicated next value for |
| 62 // displayFrameTime. The next displayFrameTime should be this value or | 80 // displayFrameTime. The next displayFrameTime should be this value or |
| 63 // greater. | 81 // greater. |
| 64 double predictedNextDisplayFrameTime; | 82 double predictedNextDisplayFrameTime; |
| 65 }; | 83 }; |
| 66 | 84 |
| 67 } // namespace blink | 85 } // namespace blink |
| 68 | 86 |
| 69 #endif | 87 #endif |
| OLD | NEW |