Chromium Code Reviews| 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 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 555 | 555 |
| 556 if (m_surface) { | 556 if (m_surface) { |
| 557 // Always save an initial frame, to support resetting the top level matrix | 557 // Always save an initial frame, to support resetting the top level matrix |
| 558 // and clip. | 558 // and clip. |
| 559 m_surface->getCanvas()->save(); | 559 m_surface->getCanvas()->save(); |
| 560 } else { | 560 } else { |
| 561 reportSurfaceCreationFailure(); | 561 reportSurfaceCreationFailure(); |
| 562 } | 562 } |
| 563 | 563 |
| 564 if (m_surface && surfaceIsAccelerated && !m_layer) { | 564 if (m_surface && surfaceIsAccelerated && !m_layer) { |
| 565 m_layer = wrapUnique( | 565 m_layer = |
| 566 Platform::current()->compositorSupport()->createExternalTextureLayer( | 566 Platform::current()->compositorSupport()->createExternalTextureLayer( |
| 567 this)); | 567 this); |
|
jbroman
2016/10/12 22:18:40
nit: this wrapping is kinda gross. I guess clang-f
dcheng
2016/10/12 22:27:03
I don't know the specifics, but I'm guessing clang
| |
| 568 m_layer->setOpaque(m_opacityMode == Opaque); | 568 m_layer->setOpaque(m_opacityMode == Opaque); |
| 569 m_layer->setBlendBackgroundColor(m_opacityMode != Opaque); | 569 m_layer->setBlendBackgroundColor(m_opacityMode != Opaque); |
| 570 GraphicsLayer::registerContentsLayer(m_layer->layer()); | 570 GraphicsLayer::registerContentsLayer(m_layer->layer()); |
| 571 m_layer->setNearestNeighbor(m_filterQuality == kNone_SkFilterQuality); | 571 m_layer->setNearestNeighbor(m_filterQuality == kNone_SkFilterQuality); |
| 572 } | 572 } |
| 573 | 573 |
| 574 if (m_surface && isHibernating()) { | 574 if (m_surface && isHibernating()) { |
| 575 if (surfaceIsAccelerated) { | 575 if (surfaceIsAccelerated) { |
| 576 m_logger->reportHibernationEvent(HibernationEndedNormally); | 576 m_logger->reportHibernationEvent(HibernationEndedNormally); |
| 577 } else { | 577 } else { |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1132 default; | 1132 default; |
| 1133 | 1133 |
| 1134 void Canvas2DLayerBridge::Logger::reportHibernationEvent( | 1134 void Canvas2DLayerBridge::Logger::reportHibernationEvent( |
| 1135 HibernationEvent event) { | 1135 HibernationEvent event) { |
| 1136 DEFINE_STATIC_LOCAL(EnumerationHistogram, hibernationHistogram, | 1136 DEFINE_STATIC_LOCAL(EnumerationHistogram, hibernationHistogram, |
| 1137 ("Canvas.HibernationEvents", HibernationEventCount)); | 1137 ("Canvas.HibernationEvents", HibernationEventCount)); |
| 1138 hibernationHistogram.count(event); | 1138 hibernationHistogram.count(event); |
| 1139 } | 1139 } |
| 1140 | 1140 |
| 1141 } // namespace blink | 1141 } // namespace blink |
| OLD | NEW |