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: Source/platform/mac/ThemeMac.mm

Issue 641643004: Reapply the non-MathExtras parts of (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2010, 2011, 2012 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008, 2010, 2011, 2012 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 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 context->translate(rect.x(), rect.y()); 543 context->translate(rect.x(), rect.y());
544 context->scale(zoomFactor, zoomFactor); 544 context->scale(zoomFactor, zoomFactor);
545 context->translate(-rect.x(), -rect.y()); 545 context->translate(-rect.x(), -rect.y());
546 } 546 }
547 CGRect bounds(rect); 547 CGRect bounds(rect);
548 CGRect backgroundBounds; 548 CGRect backgroundBounds;
549 HIThemeGetButtonBackgroundBounds(&bounds, &drawInfo, &backgroundBounds); 549 HIThemeGetButtonBackgroundBounds(&bounds, &drawInfo, &backgroundBounds);
550 // Center the stepper rectangle in the specified area. 550 // Center the stepper rectangle in the specified area.
551 backgroundBounds.origin.x = bounds.origin.x + (bounds.size.width - backgroun dBounds.size.width) / 2; 551 backgroundBounds.origin.x = bounds.origin.x + (bounds.size.width - backgroun dBounds.size.width) / 2;
552 if (backgroundBounds.size.height < bounds.size.height) { 552 if (backgroundBounds.size.height < bounds.size.height) {
553 int heightDiff = clampToInteger(bounds.size.height - backgroundBounds.si ze.height); 553 int heightDiff = clampTo<int>(bounds.size.height - backgroundBounds.size .height);
554 backgroundBounds.origin.y = bounds.origin.y + (heightDiff / 2) + 1; 554 backgroundBounds.origin.y = bounds.origin.y + (heightDiff / 2) + 1;
555 } 555 }
556 556
557 LocalCurrentGraphicsContext localContext(context, rect); 557 LocalCurrentGraphicsContext localContext(context, rect);
558 HIThemeDrawButton(&backgroundBounds, &drawInfo, localContext.cgContext(), kH IThemeOrientationNormal, 0); 558 HIThemeDrawButton(&backgroundBounds, &drawInfo, localContext.cgContext(), kH IThemeOrientationNormal, 0);
559 } 559 }
560 560
561 // This will ensure that we always return a valid NSView, even if ScrollView doe sn't have an associated document NSView. 561 // This will ensure that we always return a valid NSView, even if ScrollView doe sn't have an associated document NSView.
562 // If the ScrollView doesn't have an NSView, we will return a fake NSView whose sole purpose is to tell AppKit that it's flipped. 562 // If the ScrollView doesn't have an NSView, we will return a fake NSView whose sole purpose is to tell AppKit that it's flipped.
563 NSView *ThemeMac::ensuredView(ScrollView* scrollView) 563 NSView *ThemeMac::ensuredView(ScrollView* scrollView)
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 break; 737 break;
738 case InnerSpinButtonPart: 738 case InnerSpinButtonPart:
739 paintStepper(states, context, zoomedRect, zoomFactor, scrollView); 739 paintStepper(states, context, zoomedRect, zoomFactor, scrollView);
740 break; 740 break;
741 default: 741 default:
742 break; 742 break;
743 } 743 }
744 } 744 }
745 745
746 } 746 }
OLDNEW
« no previous file with comments | « Source/platform/graphics/skia/NativeImageSkia.cpp ('k') | Source/platform/transforms/PerspectiveTransformOperation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698