Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1161)

Side by Side Diff: Source/platform/graphics/GraphicsLayer.cpp

Issue 583733002: [blink] Pass SkBitmap by reference in WebImageLayer::setBitmap (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Simplified blink side! Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | public/platform/WebImageLayer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | public/platform/WebImageLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698