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

Side by Side Diff: third_party/WebKit/Source/core/paint/ThemePainterMac.mm

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Google, Inc. 3 * Copyright (C) 2008, 2009 Google, Inc.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 trackInfo.bounds = IntRect(IntPoint(), inflatedRect.size()); 217 trackInfo.bounds = IntRect(IntPoint(), inflatedRect.size());
218 trackInfo.min = 0; 218 trackInfo.min = 0;
219 trackInfo.max = std::numeric_limits<SInt32>::max(); 219 trackInfo.max = std::numeric_limits<SInt32>::max();
220 trackInfo.value = lround(layoutProgress.position() * nextafter(trackInfo.max , 0)); 220 trackInfo.value = lround(layoutProgress.position() * nextafter(trackInfo.max , 0));
221 trackInfo.trackInfo.progress.phase = lround(layoutProgress.animationProgress () * nextafter(LayoutThemeMac::progressAnimationNumFrames, 0)); 221 trackInfo.trackInfo.progress.phase = lround(layoutProgress.animationProgress () * nextafter(LayoutThemeMac::progressAnimationNumFrames, 0));
222 trackInfo.attributes = kThemeTrackHorizontal; 222 trackInfo.attributes = kThemeTrackHorizontal;
223 trackInfo.enableState = LayoutTheme::isActive(layoutObject) ? kThemeTrackAct ive : kThemeTrackInactive; 223 trackInfo.enableState = LayoutTheme::isActive(layoutObject) ? kThemeTrackAct ive : kThemeTrackInactive;
224 trackInfo.reserved = 0; 224 trackInfo.reserved = 0;
225 trackInfo.filler1 = 0; 225 trackInfo.filler1 = 0;
226 226
227 std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::create(inflatedRect. size()); 227 OwnPtr<ImageBuffer> imageBuffer = ImageBuffer::create(inflatedRect.size());
228 if (!imageBuffer) 228 if (!imageBuffer)
229 return true; 229 return true;
230 230
231 IntRect clipRect = IntRect(IntPoint(), inflatedRect.size()); 231 IntRect clipRect = IntRect(IntPoint(), inflatedRect.size());
232 LocalCurrentGraphicsContext localContext(imageBuffer->canvas(), 1, clipRect) ; 232 LocalCurrentGraphicsContext localContext(imageBuffer->canvas(), 1, clipRect) ;
233 CGContextRef cgContext = localContext.cgContext(); 233 CGContextRef cgContext = localContext.cgContext();
234 HIThemeDrawTrack(&trackInfo, 0, cgContext, kHIThemeOrientationNormal); 234 HIThemeDrawTrack(&trackInfo, 0, cgContext, kHIThemeOrientationNormal);
235 235
236 GraphicsContextStateSaver stateSaver(paintInfo.context); 236 GraphicsContextStateSaver stateSaver(paintInfo.context);
237 237
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 paintInfo.context.rotate(deg2rad(-45.0)); 541 paintInfo.context.rotate(deg2rad(-45.0));
542 paintInfo.context.translate(-centerX, -centerY); 542 paintInfo.context.translate(-centerX, -centerY);
543 543
544 paintInfo.context.setFillColor(fillColor); 544 paintInfo.context.setFillColor(fillColor);
545 paintInfo.context.fillEllipse(unzoomedRect); 545 paintInfo.context.fillEllipse(unzoomedRect);
546 546
547 return false; 547 return false;
548 } 548 }
549 549
550 } // namespace blink 550 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698