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

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

Issue 1427943002: Wrap SVGImage for container during paint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use IntSize for SVGImageForContainer 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 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 if (!styleImage) 808 if (!styleImage)
809 continue; 809 continue;
810 ImageResource* cachedImage = styleImage->cachedImage(); 810 ImageResource* cachedImage = styleImage->cachedImage();
811 if (!cachedImage) 811 if (!cachedImage)
812 continue; 812 continue;
813 float scale = styleImage->imageScaleFactor(); 813 float scale = styleImage->imageScaleFactor();
814 bool hotSpotSpecified = (*cursors)[i].hotSpotSpecified(); 814 bool hotSpotSpecified = (*cursors)[i].hotSpotSpecified();
815 // Get hotspot and convert from logical pixels to physical pixels. 815 // Get hotspot and convert from logical pixels to physical pixels.
816 IntPoint hotSpot = (*cursors)[i].hotSpot(); 816 IntPoint hotSpot = (*cursors)[i].hotSpot();
817 hotSpot.scale(scale, scale); 817 hotSpot.scale(scale, scale);
818 IntSize size = cachedImage->imageForLayoutObject(layoutObject)->size (); 818 IntSize size = cachedImage->image()->size();
819 if (cachedImage->errorOccurred()) 819 if (cachedImage->errorOccurred())
820 continue; 820 continue;
821 // Limit the size of cursors (in UI pixels) so that they cannot be 821 // Limit the size of cursors (in UI pixels) so that they cannot be
822 // used to cover UI elements in chrome. 822 // used to cover UI elements in chrome.
823 size.scale(1 / scale); 823 size.scale(1 / scale);
824 if (size.width() > maximumCursorSize || size.height() > maximumCurso rSize) 824 if (size.width() > maximumCursorSize || size.height() > maximumCurso rSize)
825 continue; 825 continue;
826 826
827 Image* image = cachedImage->imageForLayoutObject(layoutObject); 827 Image* image = cachedImage->image();
828 // Ensure no overflow possible in calculations above. 828 // Ensure no overflow possible in calculations above.
829 if (scale < minimumCursorScale) 829 if (scale < minimumCursorScale)
830 continue; 830 continue;
831 return Cursor(image, hotSpotSpecified, hotSpot, scale); 831 return Cursor(image, hotSpotSpecified, hotSpot, scale);
832 } 832 }
833 } 833 }
834 834
835 switch (style ? style->cursor() : CURSOR_AUTO) { 835 switch (style ? style->cursor() : CURSOR_AUTO) {
836 case CURSOR_AUTO: { 836 case CURSOR_AUTO: {
837 bool horizontalText = !style || style->isHorizontalWritingMode(); 837 bool horizontalText = !style || style->isHorizontalWritingMode();
(...skipping 3249 matching lines...) Expand 10 before | Expand all | Expand 10 after
4087 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() 4087 PlatformEvent::Modifiers EventHandler::accessKeyModifiers()
4088 { 4088 {
4089 #if OS(MACOSX) 4089 #if OS(MACOSX)
4090 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey); 4090 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey);
4091 #else 4091 #else
4092 return PlatformEvent::AltKey; 4092 return PlatformEvent::AltKey;
4093 #endif 4093 #endif
4094 } 4094 }
4095 4095
4096 } // namespace blink 4096 } // 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