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

Side by Side Diff: Source/core/layout/compositing/CompositedDeprecatedPaintLayerMapping.cpp

Issue 1162793003: Add CSS image-orientation: from-image (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address even more review comments Created 5 years, 6 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 #include "core/paint/DeprecatedPaintLayerPainter.h" 50 #include "core/paint/DeprecatedPaintLayerPainter.h"
51 #include "core/paint/DeprecatedPaintLayerStackingNodeIterator.h" 51 #include "core/paint/DeprecatedPaintLayerStackingNodeIterator.h"
52 #include "core/paint/ScrollableAreaPainter.h" 52 #include "core/paint/ScrollableAreaPainter.h"
53 #include "core/paint/TransformRecorder.h" 53 #include "core/paint/TransformRecorder.h"
54 #include "core/plugins/PluginView.h" 54 #include "core/plugins/PluginView.h"
55 #include "core/style/KeyframeList.h" 55 #include "core/style/KeyframeList.h"
56 #include "platform/LengthFunctions.h" 56 #include "platform/LengthFunctions.h"
57 #include "platform/RuntimeEnabledFeatures.h" 57 #include "platform/RuntimeEnabledFeatures.h"
58 #include "platform/fonts/FontCache.h" 58 #include "platform/fonts/FontCache.h"
59 #include "platform/geometry/TransformState.h" 59 #include "platform/geometry/TransformState.h"
60 #include "platform/graphics/BitmapImage.h"
60 #include "platform/graphics/GraphicsContext.h" 61 #include "platform/graphics/GraphicsContext.h"
61 #include "platform/graphics/paint/ClipDisplayItem.h" 62 #include "platform/graphics/paint/ClipDisplayItem.h"
62 #include "platform/graphics/paint/DisplayItemList.h" 63 #include "platform/graphics/paint/DisplayItemList.h"
63 #include "platform/graphics/paint/TransformDisplayItem.h" 64 #include "platform/graphics/paint/TransformDisplayItem.h"
64 #include "wtf/CurrentTime.h" 65 #include "wtf/CurrentTime.h"
65 #include "wtf/text/StringBuilder.h" 66 #include "wtf/text/StringBuilder.h"
66 67
67 namespace blink { 68 namespace blink {
68 69
69 using namespace HTMLNames; 70 using namespace HTMLNames;
(...skipping 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after
1840 LayoutObject* layoutObject = this->layoutObject(); 1841 LayoutObject* layoutObject = this->layoutObject();
1841 if (m_owningLayer.hasBoxDecorationsOrBackground() || layoutObject->hasClip() || layoutObject->hasClipPath()) 1842 if (m_owningLayer.hasBoxDecorationsOrBackground() || layoutObject->hasClip() || layoutObject->hasClipPath())
1842 return false; 1843 return false;
1843 1844
1844 LayoutImage* imageLayoutObject = toLayoutImage(layoutObject); 1845 LayoutImage* imageLayoutObject = toLayoutImage(layoutObject);
1845 if (ImageResource* cachedImage = imageLayoutObject->cachedImage()) { 1846 if (ImageResource* cachedImage = imageLayoutObject->cachedImage()) {
1846 if (!cachedImage->hasImage()) 1847 if (!cachedImage->hasImage())
1847 return false; 1848 return false;
1848 1849
1849 Image* image = cachedImage->imageForLayoutObject(imageLayoutObject); 1850 Image* image = cachedImage->imageForLayoutObject(imageLayoutObject);
1850 return image->isBitmapImage(); 1851 if (!image->isBitmapImage())
1852 return false;
1853
1854 if (imageLayoutObject->style()->respectImageOrientation() != RespectImag eOrientation)
1855 return true;
1851 } 1856 }
1852 1857
1853 return false; 1858 return false;
1854 } 1859 }
1855 1860
1856 void CompositedDeprecatedPaintLayerMapping::contentChanged(ContentChangeType cha ngeType) 1861 void CompositedDeprecatedPaintLayerMapping::contentChanged(ContentChangeType cha ngeType)
1857 { 1862 {
1858 if ((changeType == ImageChanged) && layoutObject()->isImage() && isDirectlyC ompositedImage()) { 1863 if ((changeType == ImageChanged) && layoutObject()->isImage() && isDirectlyC ompositedImage()) {
1859 updateImageContents(); 1864 updateImageContents();
1860 return; 1865 return;
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
2339 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { 2344 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) {
2340 name = "Scrolling Block Selection Layer"; 2345 name = "Scrolling Block Selection Layer";
2341 } else { 2346 } else {
2342 ASSERT_NOT_REACHED(); 2347 ASSERT_NOT_REACHED();
2343 } 2348 }
2344 2349
2345 return name; 2350 return name;
2346 } 2351 }
2347 2352
2348 } // namespace blink 2353 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698