Changeset 295718 in webkit for trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
- Timestamp:
- Jun 21, 2022, 8:12:18 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r295630 r295718 112 112 SimpleContainer, 113 113 DirectlyCompositedImage, 114 Painted 114 UnscaledBitmapOnly, 115 Painted, 115 116 }; 116 117 … … 157 158 } 158 159 160 bool isUnscaledBitmapOnly() 161 { 162 return contentsTypeDetermination() == ContentsTypeDetermination::UnscaledBitmapOnly; 163 } 164 159 165 RenderLayerBacking& m_backing; 160 166 RequestState m_boxDecorations { RequestState::Unknown }; … … 210 216 else if (m_backing.isDirectlyCompositedImage()) 211 217 m_contentsType = ContentsTypeDetermination::DirectlyCompositedImage; 218 else if (m_backing.isUnscaledBitmapOnly()) 219 m_contentsType = ContentsTypeDetermination::UnscaledBitmapOnly; 212 220 else 213 221 m_contentsType = ContentsTypeDetermination::Painted; … … 1068 1076 if (contentsInfo.isDirectlyCompositedImage()) 1069 1077 updateImageContents(contentsInfo); 1078 1079 bool unscaledBitmap = contentsInfo.isUnscaledBitmapOnly(); 1080 if (unscaledBitmap == m_graphicsLayer->appliesDeviceScale()) { 1081 m_graphicsLayer->setAppliesDeviceScale(!unscaledBitmap); 1082 layerConfigChanged = true; 1083 } 1070 1084 1071 1085 if (is<RenderEmbeddedObject>(renderer()) && downcast<RenderEmbeddedObject>(renderer()).allowsAcceleratedCompositing()) { … … 2913 2927 } 2914 2928 2929 bool RenderLayerBacking::isUnscaledBitmapOnly() const 2930 { 2931 if (!is<RenderImage>(renderer()) && !is<RenderHTMLCanvas>(renderer())) 2932 return false; 2933 2934 if (m_owningLayer.hasVisibleBoxDecorationsOrBackground()) 2935 return false; 2936 2937 auto contents = contentsBox(); 2938 if (contents.location() != LayoutPoint(0, 0)) 2939 return false; 2940 2941 if (is<RenderImage>(renderer())) { 2942 auto& imageRenderer = downcast<RenderImage>(renderer()); 2943 if (auto* cachedImage = imageRenderer.cachedImage()) { 2944 if (!cachedImage->hasImage()) 2945 return false; 2946 2947 auto* image = cachedImage->imageForRenderer(&imageRenderer); 2948 if (!is<BitmapImage>(image)) 2949 return false; 2950 2951 if (downcast<BitmapImage>(*image).orientationForCurrentFrame() != ImageOrientation::None) 2952 return false; 2953 2954 return contents.size() == image->size(); 2955 } 2956 return false; 2957 } 2958 2959 auto& canvasRenderer = downcast<RenderHTMLCanvas>(renderer()); 2960 if (snappedIntRect(contents).size() == canvasRenderer.canvasElement().size()) 2961 return true; 2962 return false; 2963 } 2964 2915 2965 void RenderLayerBacking::contentChanged(ContentChangeType changeType) 2916 2966 { 2917 2967 PaintedContentsInfo contentsInfo(*this); 2918 if ((changeType == ImageChanged) && contentsInfo.isDirectlyCompositedImage()) { 2919 updateImageContents(contentsInfo); 2920 return; 2968 if (changeType == ImageChanged) { 2969 if (contentsInfo.isDirectlyCompositedImage()) { 2970 updateImageContents(contentsInfo); 2971 return; 2972 } 2973 if (contentsInfo.isUnscaledBitmapOnly()) { 2974 compositor().scheduleCompositingLayerUpdate(); 2975 return; 2976 } 2921 2977 } 2922 2978
Note:
See TracChangeset
for help on using the changeset viewer.