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 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 } | 923 } |
924 | 924 |
925 void GraphicsLayer::setContentsToImage(Image* image) | 925 void GraphicsLayer::setContentsToImage(Image* image) |
926 { | 926 { |
927 RefPtr<NativeImageSkia> nativeImage = image ? image->nativeImageForCurrentFr
ame() : nullptr; | 927 RefPtr<NativeImageSkia> nativeImage = image ? image->nativeImageForCurrentFr
ame() : nullptr; |
928 if (nativeImage) { | 928 if (nativeImage) { |
929 if (!m_imageLayer) { | 929 if (!m_imageLayer) { |
930 m_imageLayer = adoptPtr(Platform::current()->compositorSupport()->cr
eateImageLayer()); | 930 m_imageLayer = adoptPtr(Platform::current()->compositorSupport()->cr
eateImageLayer()); |
931 registerContentsLayer(m_imageLayer->layer()); | 931 registerContentsLayer(m_imageLayer->layer()); |
932 } | 932 } |
933 m_imageLayer->setBitmap(nativeImage->bitmap()); | 933 m_imageLayer->setImageBitmap(nativeImage->bitmap()); |
934 m_imageLayer->layer()->setOpaque(image->currentFrameKnownToBeOpaque()); | 934 m_imageLayer->layer()->setOpaque(image->currentFrameKnownToBeOpaque()); |
935 updateContentsRect(); | 935 updateContentsRect(); |
936 } else { | 936 } else { |
937 if (m_imageLayer) { | 937 if (m_imageLayer) { |
938 unregisterContentsLayer(m_imageLayer->layer()); | 938 unregisterContentsLayer(m_imageLayer->layer()); |
939 m_imageLayer.clear(); | 939 m_imageLayer.clear(); |
940 } | 940 } |
941 } | 941 } |
942 | 942 |
943 setContentsTo(m_imageLayer ? m_imageLayer->layer() : 0); | 943 setContentsTo(m_imageLayer ? m_imageLayer->layer() : 0); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1062 #ifndef NDEBUG | 1062 #ifndef NDEBUG |
1063 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) | 1063 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) |
1064 { | 1064 { |
1065 if (!layer) | 1065 if (!layer) |
1066 return; | 1066 return; |
1067 | 1067 |
1068 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); | 1068 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); |
1069 fprintf(stderr, "%s\n", output.utf8().data()); | 1069 fprintf(stderr, "%s\n", output.utf8().data()); |
1070 } | 1070 } |
1071 #endif | 1071 #endif |
OLD | NEW |