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

Side by Side Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 1367193003: NOT FOR LANDING Allocate SVGImageForContainer on demand (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added some NeedsRebaseline and revived some LayoutListMarker code that turned out to be important Created 5 years, 1 month 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) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 if (!styleImage) 749 if (!styleImage)
750 continue; 750 continue;
751 ImageResource* cachedImage = styleImage->cachedImage(); 751 ImageResource* cachedImage = styleImage->cachedImage();
752 if (!cachedImage) 752 if (!cachedImage)
753 continue; 753 continue;
754 float scale = styleImage->imageScaleFactor(); 754 float scale = styleImage->imageScaleFactor();
755 bool hotSpotSpecified = (*cursors)[i].hotSpotSpecified(); 755 bool hotSpotSpecified = (*cursors)[i].hotSpotSpecified();
756 // Get hotspot and convert from logical pixels to physical pixels. 756 // Get hotspot and convert from logical pixels to physical pixels.
757 IntPoint hotSpot = (*cursors)[i].hotSpot(); 757 IntPoint hotSpot = (*cursors)[i].hotSpot();
758 hotSpot.scale(scale, scale); 758 hotSpot.scale(scale, scale);
759 IntSize size = cachedImage->imageForLayoutObject(layoutObject)->size (); 759 IntSize size = cachedImage->image()->size();
760 if (cachedImage->errorOccurred()) 760 if (cachedImage->errorOccurred())
761 continue; 761 continue;
762 // Limit the size of cursors (in UI pixels) so that they cannot be 762 // Limit the size of cursors (in UI pixels) so that they cannot be
763 // used to cover UI elements in chrome. 763 // used to cover UI elements in chrome.
764 size.scale(1 / scale); 764 size.scale(1 / scale);
765 if (size.width() > maximumCursorSize || size.height() > maximumCurso rSize) 765 if (size.width() > maximumCursorSize || size.height() > maximumCurso rSize)
766 continue; 766 continue;
767 767
768 Image* image = cachedImage->imageForLayoutObject(layoutObject); 768 Image* image = cachedImage->image();
769 // Ensure no overflow possible in calculations above. 769 // Ensure no overflow possible in calculations above.
770 if (scale < minimumCursorScale) 770 if (scale < minimumCursorScale)
771 continue; 771 continue;
772 return Cursor(image, hotSpotSpecified, hotSpot, scale); 772 return Cursor(image, hotSpotSpecified, hotSpot, scale);
773 } 773 }
774 } 774 }
775 775
776 switch (style ? style->cursor() : CURSOR_AUTO) { 776 switch (style ? style->cursor() : CURSOR_AUTO) {
777 case CURSOR_AUTO: { 777 case CURSOR_AUTO: {
778 bool horizontalText = !style || style->isHorizontalWritingMode(); 778 bool horizontalText = !style || style->isHorizontalWritingMode();
(...skipping 3255 matching lines...) Expand 10 before | Expand all | Expand 10 after
4034 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() 4034 PlatformEvent::Modifiers EventHandler::accessKeyModifiers()
4035 { 4035 {
4036 #if OS(MACOSX) 4036 #if OS(MACOSX)
4037 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey); 4037 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey);
4038 #else 4038 #else
4039 return PlatformEvent::AltKey; 4039 return PlatformEvent::AltKey;
4040 #endif 4040 #endif
4041 } 4041 }
4042 4042
4043 } // namespace blink 4043 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLImageElement.cpp ('k') | third_party/WebKit/Source/core/layout/HitTestResult.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698