| 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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 m_layer->setNearestNeighbor(m_filterQuality == kNone_SkFilterQuality); | 494 m_layer->setNearestNeighbor(m_filterQuality == kNone_SkFilterQuality); |
| 495 } | 495 } |
| 496 | 496 |
| 497 void Canvas2DLayerBridge::setIsHidden(bool hidden) | 497 void Canvas2DLayerBridge::setIsHidden(bool hidden) |
| 498 { | 498 { |
| 499 bool newHiddenValue = hidden || m_destructionInProgress; | 499 bool newHiddenValue = hidden || m_destructionInProgress; |
| 500 if (m_isHidden == newHiddenValue) | 500 if (m_isHidden == newHiddenValue) |
| 501 return; | 501 return; |
| 502 | 502 |
| 503 m_isHidden = newHiddenValue; | 503 m_isHidden = newHiddenValue; |
| 504 if (m_surface && isHidden() && !m_destructionInProgress && !m_hibernationSch
eduled) { | 504 if (CANVAS2D_HIBERNATION_ENABLED && m_surface && isHidden() && !m_destructio
nInProgress && !m_hibernationScheduled) { |
| 505 if (m_layer) | 505 if (m_layer) |
| 506 m_layer->clearTexture(); | 506 m_layer->clearTexture(); |
| 507 m_logger->reportHibernationEvent(HibernationScheduled); | 507 m_logger->reportHibernationEvent(HibernationScheduled); |
| 508 m_hibernationScheduled = true; | 508 m_hibernationScheduled = true; |
| 509 Platform::current()->currentThread()->scheduler()->postIdleTask(BLINK_FR
OM_HERE, WTF::bind<double>(&hibernateWrapper, m_weakPtrFactory.createWeakPtr()))
; | 509 Platform::current()->currentThread()->scheduler()->postIdleTask(BLINK_FR
OM_HERE, WTF::bind<double>(&hibernateWrapper, m_weakPtrFactory.createWeakPtr()))
; |
| 510 } | 510 } |
| 511 if (!isHidden() && m_softwareRenderingWhileHidden) { | 511 if (!isHidden() && m_softwareRenderingWhileHidden) { |
| 512 flushRecordingOnly(); | 512 flushRecordingOnly(); |
| 513 SkPaint copyPaint; | 513 SkPaint copyPaint; |
| 514 copyPaint.setXfermodeMode(SkXfermode::kSrc_Mode); | 514 copyPaint.setXfermodeMode(SkXfermode::kSrc_Mode); |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 849 m_parentLayerBridge = other.m_parentLayerBridge; | 849 m_parentLayerBridge = other.m_parentLayerBridge; |
| 850 } | 850 } |
| 851 | 851 |
| 852 void Canvas2DLayerBridge::Logger::reportHibernationEvent(HibernationEvent event) | 852 void Canvas2DLayerBridge::Logger::reportHibernationEvent(HibernationEvent event) |
| 853 { | 853 { |
| 854 DEFINE_STATIC_LOCAL(EnumerationHistogram, hibernationHistogram, ("Canvas.Hib
ernationEvents", HibernationEventCount)); | 854 DEFINE_STATIC_LOCAL(EnumerationHistogram, hibernationHistogram, ("Canvas.Hib
ernationEvents", HibernationEventCount)); |
| 855 hibernationHistogram.count(event); | 855 hibernationHistogram.count(event); |
| 856 } | 856 } |
| 857 | 857 |
| 858 } // namespace blink | 858 } // namespace blink |
| OLD | NEW |