| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 929 { | 929 { |
| 930 // Note carefully this early-exit is only correct because we also properly c
all | 930 // Note carefully this early-exit is only correct because we also properly c
all |
| 931 // WebLayer::setDrawsContent whenever m_contentsLayer is set to a new layer
in setupContentsLayer(). | 931 // WebLayer::setDrawsContent whenever m_contentsLayer is set to a new layer
in setupContentsLayer(). |
| 932 if (drawsContent == m_drawsContent) | 932 if (drawsContent == m_drawsContent) |
| 933 return; | 933 return; |
| 934 | 934 |
| 935 m_drawsContent = drawsContent; | 935 m_drawsContent = drawsContent; |
| 936 updateLayerIsDrawable(); | 936 updateLayerIsDrawable(); |
| 937 | 937 |
| 938 if (!drawsContent && m_paintController) | 938 if (!drawsContent && m_paintController) |
| 939 m_paintController.clear(); | 939 m_paintController.reset(); |
| 940 } | 940 } |
| 941 | 941 |
| 942 void GraphicsLayer::setContentsVisible(bool contentsVisible) | 942 void GraphicsLayer::setContentsVisible(bool contentsVisible) |
| 943 { | 943 { |
| 944 // Note carefully this early-exit is only correct because we also properly c
all | 944 // Note carefully this early-exit is only correct because we also properly c
all |
| 945 // WebLayer::setDrawsContent whenever m_contentsLayer is set to a new layer
in setupContentsLayer(). | 945 // WebLayer::setDrawsContent whenever m_contentsLayer is set to a new layer
in setupContentsLayer(). |
| 946 if (contentsVisible == m_contentsVisible) | 946 if (contentsVisible == m_contentsVisible) |
| 947 return; | 947 return; |
| 948 | 948 |
| 949 m_contentsVisible = contentsVisible; | 949 m_contentsVisible = contentsVisible; |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1107 if (!m_imageLayer) { | 1107 if (!m_imageLayer) { |
| 1108 m_imageLayer = adoptPtr(Platform::current()->compositorSupport()->cr
eateImageLayer()); | 1108 m_imageLayer = adoptPtr(Platform::current()->compositorSupport()->cr
eateImageLayer()); |
| 1109 registerContentsLayer(m_imageLayer->layer()); | 1109 registerContentsLayer(m_imageLayer->layer()); |
| 1110 } | 1110 } |
| 1111 m_imageLayer->setImage(skImage.get()); | 1111 m_imageLayer->setImage(skImage.get()); |
| 1112 m_imageLayer->layer()->setOpaque(image->currentFrameKnownToBeOpaque()); | 1112 m_imageLayer->layer()->setOpaque(image->currentFrameKnownToBeOpaque()); |
| 1113 updateContentsRect(); | 1113 updateContentsRect(); |
| 1114 } else { | 1114 } else { |
| 1115 if (m_imageLayer) { | 1115 if (m_imageLayer) { |
| 1116 unregisterContentsLayer(m_imageLayer->layer()); | 1116 unregisterContentsLayer(m_imageLayer->layer()); |
| 1117 m_imageLayer.clear(); | 1117 m_imageLayer.reset(); |
| 1118 } | 1118 } |
| 1119 } | 1119 } |
| 1120 | 1120 |
| 1121 setContentsTo(m_imageLayer ? m_imageLayer->layer() : 0); | 1121 setContentsTo(m_imageLayer ? m_imageLayer->layer() : 0); |
| 1122 } | 1122 } |
| 1123 | 1123 |
| 1124 WebLayer* GraphicsLayer::platformLayer() const | 1124 WebLayer* GraphicsLayer::platformLayer() const |
| 1125 { | 1125 { |
| 1126 return m_layer->layer(); | 1126 return m_layer->layer(); |
| 1127 } | 1127 } |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1228 { | 1228 { |
| 1229 if (!layer) { | 1229 if (!layer) { |
| 1230 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); | 1230 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); |
| 1231 return; | 1231 return; |
| 1232 } | 1232 } |
| 1233 | 1233 |
| 1234 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); | 1234 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); |
| 1235 fprintf(stderr, "%s\n", output.utf8().data()); | 1235 fprintf(stderr, "%s\n", output.utf8().data()); |
| 1236 } | 1236 } |
| 1237 #endif | 1237 #endif |
| OLD | NEW |