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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 1361413004: Fix directly composited image path for CSS image-orientation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing Created 5 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 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 1853 matching lines...) Expand 10 before | Expand all | Expand 10 after
1864 1864
1865 LayoutImage* imageLayoutObject = toLayoutImage(layoutObject); 1865 LayoutImage* imageLayoutObject = toLayoutImage(layoutObject);
1866 if (ImageResource* cachedImage = imageLayoutObject->cachedImage()) { 1866 if (ImageResource* cachedImage = imageLayoutObject->cachedImage()) {
1867 if (!cachedImage->hasImage()) 1867 if (!cachedImage->hasImage())
1868 return false; 1868 return false;
1869 1869
1870 Image* image = cachedImage->imageForLayoutObject(imageLayoutObject); 1870 Image* image = cachedImage->imageForLayoutObject(imageLayoutObject);
1871 if (!image->isBitmapImage()) 1871 if (!image->isBitmapImage())
1872 return false; 1872 return false;
1873 1873
1874 // FIXME: We should be able to handle bitmap images using direct composi ting 1874 return true;
1875 // no matter what image-orientation value. See crbug.com/502267
1876 if (imageLayoutObject->style()->respectImageOrientation() != RespectImag eOrientation)
1877 return true;
1878 } 1875 }
1879 1876
1880 return false; 1877 return false;
1881 } 1878 }
1882 1879
1883 void CompositedLayerMapping::contentChanged(ContentChangeType changeType) 1880 void CompositedLayerMapping::contentChanged(ContentChangeType changeType)
1884 { 1881 {
1885 if ((changeType == ImageChanged) && layoutObject()->isImage() && isDirectlyC ompositedImage()) { 1882 if ((changeType == ImageChanged) && layoutObject()->isImage() && isDirectlyC ompositedImage()) {
1886 updateImageContents(); 1883 updateImageContents();
1887 return; 1884 return;
(...skipping 12 matching lines...) Expand all
1900 1897
1901 ImageResource* cachedImage = imageLayoutObject->cachedImage(); 1898 ImageResource* cachedImage = imageLayoutObject->cachedImage();
1902 if (!cachedImage) 1899 if (!cachedImage)
1903 return; 1900 return;
1904 1901
1905 Image* image = cachedImage->imageForLayoutObject(imageLayoutObject); 1902 Image* image = cachedImage->imageForLayoutObject(imageLayoutObject);
1906 if (!image) 1903 if (!image)
1907 return; 1904 return;
1908 1905
1909 // This is a no-op if the layer doesn't have an inner layer for the image. 1906 // This is a no-op if the layer doesn't have an inner layer for the image.
1910 m_graphicsLayer->setContentsToImage(image); 1907 m_graphicsLayer->setContentsToImage(image, imageLayoutObject->shouldRespectI mageOrientation());
1911 1908
1912 m_graphicsLayer->setFilterQuality(layoutObject()->style()->imageRendering() == ImageRenderingPixelated ? kNone_SkFilterQuality : kLow_SkFilterQuality); 1909 m_graphicsLayer->setFilterQuality(layoutObject()->style()->imageRendering() == ImageRenderingPixelated ? kNone_SkFilterQuality : kLow_SkFilterQuality);
1913 1910
1914 // Prevent double-drawing: https://bugs.webkit.org/show_bug.cgi?id=58632 1911 // Prevent double-drawing: https://bugs.webkit.org/show_bug.cgi?id=58632
1915 updateDrawsContent(); 1912 updateDrawsContent();
1916 1913
1917 // Image animation is "lazy", in that it automatically stops unless someone is drawing 1914 // Image animation is "lazy", in that it automatically stops unless someone is drawing
1918 // the image. So we have to kick the animation each time; this has the downs ide that the 1915 // the image. So we have to kick the animation each time; this has the downs ide that the
1919 // image will keep animating, even if its layer is not visible. 1916 // image will keep animating, even if its layer is not visible.
1920 image->startAnimation(); 1917 image->startAnimation();
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
2394 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { 2391 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) {
2395 name = "Scrolling Block Selection Layer"; 2392 name = "Scrolling Block Selection Layer";
2396 } else { 2393 } else {
2397 ASSERT_NOT_REACHED(); 2394 ASSERT_NOT_REACHED();
2398 } 2395 }
2399 2396
2400 return name; 2397 return name;
2401 } 2398 }
2402 2399
2403 } // namespace blink 2400 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698