| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 if (m_layer && !m_destructionInProgress) | 513 if (m_layer && !m_destructionInProgress) |
| 514 checkSurfaceValid(); // To ensure rate limiter is disabled if context is
lost. | 514 checkSurfaceValid(); // To ensure rate limiter is disabled if context is
lost. |
| 515 return m_contextProvider ? m_contextProvider->context3d() : 0; | 515 return m_contextProvider ? m_contextProvider->context3d() : 0; |
| 516 } | 516 } |
| 517 | 517 |
| 518 bool Canvas2DLayerBridge::checkSurfaceValid() | 518 bool Canvas2DLayerBridge::checkSurfaceValid() |
| 519 { | 519 { |
| 520 ASSERT(!m_destructionInProgress); | 520 ASSERT(!m_destructionInProgress); |
| 521 if (m_destructionInProgress) | 521 if (m_destructionInProgress) |
| 522 return false; | 522 return false; |
| 523 if (isHibernating()) | |
| 524 return true; | |
| 525 if (!m_layer) | 523 if (!m_layer) |
| 526 return true; | 524 return true; |
| 527 if (!m_surface) | 525 if (!m_surface) |
| 528 return false; | 526 return false; |
| 529 if (m_contextProvider->context3d()->isContextLost()) { | 527 if (m_contextProvider->context3d()->isContextLost()) { |
| 530 m_surface.clear(); | 528 m_surface.clear(); |
| 531 for (auto mailboxInfo = m_mailboxes.begin(); mailboxInfo != m_mailboxes.
end(); ++mailboxInfo) { | 529 for (auto mailboxInfo = m_mailboxes.begin(); mailboxInfo != m_mailboxes.
end(); ++mailboxInfo) { |
| 532 if (mailboxInfo->m_image) | 530 if (mailboxInfo->m_image) |
| 533 mailboxInfo->m_image.clear(); | 531 mailboxInfo->m_image.clear(); |
| 534 } | 532 } |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 m_image = other.m_image; | 820 m_image = other.m_image; |
| 823 m_parentLayerBridge = other.m_parentLayerBridge; | 821 m_parentLayerBridge = other.m_parentLayerBridge; |
| 824 } | 822 } |
| 825 | 823 |
| 826 void Canvas2DLayerBridge::Logger::reportHibernationEvent(HibernationEvent event) | 824 void Canvas2DLayerBridge::Logger::reportHibernationEvent(HibernationEvent event) |
| 827 { | 825 { |
| 828 blink::Platform::current()->histogramEnumeration("Canvas.HibernationEvents",
event, HibernationEventCount); | 826 blink::Platform::current()->histogramEnumeration("Canvas.HibernationEvents",
event, HibernationEventCount); |
| 829 } | 827 } |
| 830 | 828 |
| 831 } // namespace blink | 829 } // namespace blink |
| OLD | NEW |