| 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 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 if (lostResource) { | 843 if (lostResource) { |
| 844 texture->abandon(); | 844 texture->abandon(); |
| 845 } else { | 845 } else { |
| 846 texture->textureParamsModified(); | 846 texture->textureParamsModified(); |
| 847 } | 847 } |
| 848 } | 848 } |
| 849 } | 849 } |
| 850 | 850 |
| 851 #if USE_IOSURFACE_FOR_2D_CANVAS | 851 #if USE_IOSURFACE_FOR_2D_CANVAS |
| 852 if (!releasedMailboxInfo->m_imageInfo.empty() && !lostResource) { | 852 if (!releasedMailboxInfo->m_imageInfo.empty() && !lostResource) { |
| 853 m_imageInfoCache.append(releasedMailboxInfo->m_imageInfo); | 853 // IOSurface texures can't be reused, because the compositor returns |
| 854 // them while they are still in use, and the SyncToken isn't |
| 855 // relevant. https://crbug.com/608026. |
| 856 deleteCHROMIUMImage(releasedMailboxInfo->m_imageInfo); |
| 854 } | 857 } |
| 855 #endif // USE_IOSURFACE_FOR_2D_CANVAS | 858 #endif // USE_IOSURFACE_FOR_2D_CANVAS |
| 856 } | 859 } |
| 857 | 860 |
| 858 RefPtr<Canvas2DLayerBridge> selfRef; | 861 RefPtr<Canvas2DLayerBridge> selfRef; |
| 859 if (m_destructionInProgress) { | 862 if (m_destructionInProgress) { |
| 860 // To avoid memory use after free, take a scoped self-reference | 863 // To avoid memory use after free, take a scoped self-reference |
| 861 // to postpone destruction until the end of this function. | 864 // to postpone destruction until the end of this function. |
| 862 selfRef = this; | 865 selfRef = this; |
| 863 } | 866 } |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 #endif // USE_IOSURFACE_FOR_2D_CANVAS | 986 #endif // USE_IOSURFACE_FOR_2D_CANVAS |
| 984 } | 987 } |
| 985 | 988 |
| 986 void Canvas2DLayerBridge::Logger::reportHibernationEvent(HibernationEvent event) | 989 void Canvas2DLayerBridge::Logger::reportHibernationEvent(HibernationEvent event) |
| 987 { | 990 { |
| 988 DEFINE_STATIC_LOCAL(EnumerationHistogram, hibernationHistogram, ("Canvas.Hib
ernationEvents", HibernationEventCount)); | 991 DEFINE_STATIC_LOCAL(EnumerationHistogram, hibernationHistogram, ("Canvas.Hib
ernationEvents", HibernationEventCount)); |
| 989 hibernationHistogram.count(event); | 992 hibernationHistogram.count(event); |
| 990 } | 993 } |
| 991 | 994 |
| 992 } // namespace blink | 995 } // namespace blink |
| OLD | NEW |