Skip to content

Commit 024bd87

Browse files
Fix progress bar regression on Mac
The clip rect in r183006 wasn't manually tested, and was wrong. Specify the un-translated clip rect, which empirically produces correct results in a variety of test scenarios (zoomed, retina, various page locations). Use a LocalCurrentGraphicsContext and delete ContextContainer, because it is largely redundant. BUG=419597 Review URL: https://codereview.chromium.org/620673006 git-svn-id: svn://svn.chromium.org/blink/trunk@183162 bbb929c8-8fbe-4397-9dbb-9b2b20218538
1 parent ef8cdb9 commit 024bd87

File tree

3 files changed

+2
-23
lines changed

3 files changed

+2
-23
lines changed

Source/core/rendering/RenderThemeChromiumMac.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,8 +1052,8 @@ static NSControlSize searchFieldControlSizeForFont(RenderStyle* style)
10521052
if (!imageBuffer)
10531053
return true;
10541054

1055-
ContextContainer cgContextContainer(imageBuffer->context(), inflatedRect);
1056-
CGContextRef cgContext = cgContextContainer.context();
1055+
LocalCurrentGraphicsContext localContext(imageBuffer->context(), IntRect(IntPoint(), inflatedRect.size()));
1056+
CGContextRef cgContext = localContext.cgContext();
10571057
HIThemeDrawTrack(&trackInfo, 0, cgContext, kHIThemeOrientationNormal);
10581058

10591059
GraphicsContextStateSaver stateSaver(*paintInfo.context);

Source/platform/mac/LocalCurrentGraphicsContext.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,4 @@ class PLATFORM_EXPORT LocalCurrentGraphicsContext {
4444
gfx::SkiaBitLocker m_skiaBitLocker;
4545
};
4646

47-
class PLATFORM_EXPORT ContextContainer {
48-
WTF_MAKE_NONCOPYABLE(ContextContainer);
49-
public:
50-
ContextContainer(GraphicsContext*, IntRect clipRect);
51-
52-
// This synchronizes the CGContext to reflect the current SkCanvas state.
53-
// The implementation may not return the same CGContext each time.
54-
CGContextRef context() { return m_skiaBitLocker.cgContext(); }
55-
56-
private:
57-
gfx::SkiaBitLocker m_skiaBitLocker;
58-
};
59-
6047
}

Source/platform/mac/LocalCurrentGraphicsContext.mm

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,4 @@
6767
return cgContext;
6868
}
6969

70-
ContextContainer::ContextContainer(GraphicsContext* graphicsContext,
71-
IntRect clipRect)
72-
: m_skiaBitLocker(graphicsContext->canvas(),
73-
ThemeMac::inflateRectForAA(clipRect),
74-
graphicsContext->deviceScaleFactor())
75-
{
76-
}
77-
7870
}

0 commit comments

Comments
 (0)