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

Unified Diff: Source/platform/scroll/ScrollbarThemeMacNonOverlayAPI.mm

Issue 1170523002: Removing GraphicsContext from ImageBuffer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix for shape bug Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/scroll/ScrollbarThemeMacCommon.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/scroll/ScrollbarThemeMacNonOverlayAPI.mm
diff --git a/Source/platform/scroll/ScrollbarThemeMacNonOverlayAPI.mm b/Source/platform/scroll/ScrollbarThemeMacNonOverlayAPI.mm
index 249775a40b0bc6481cd35d5748c23f353f0cdc38..f344e339e0f3fb9249c5022fbc852f0464ac3c1e 100644
--- a/Source/platform/scroll/ScrollbarThemeMacNonOverlayAPI.mm
+++ b/Source/platform/scroll/ScrollbarThemeMacNonOverlayAPI.mm
@@ -114,8 +114,8 @@ bool ScrollbarThemeMacNonOverlayAPI::paint(ScrollbarThemeClient* scrollbar, Grap
// The Aqua scrollbar is buggy when rotated and scaled. We will just draw into a bitmap if we detect a scale or rotation.
bool canDrawDirectly = currentCTM.a == 1.0f && currentCTM.b == 0.0f && currentCTM.c == 0.0f && (currentCTM.d == 1.0f || currentCTM.d == -1.0f);
- GraphicsContext* drawingContext = context;
OwnPtr<ImageBuffer> imageBuffer;
+ SkCanvas* drawingCanvas;
if (!canDrawDirectly) {
trackInfo.bounds = IntRect(IntPoint(), scrollbar->frameRect().size());
@@ -127,14 +127,16 @@ bool ScrollbarThemeMacNonOverlayAPI::paint(ScrollbarThemeClient* scrollbar, Grap
if (!imageBuffer)
return true;
- drawingContext = imageBuffer->context();
+ drawingCanvas = imageBuffer->canvas();
+ } else {
+ drawingCanvas = canvas;
}
// Draw the track and its thumb.
gfx::SkiaBitLocker bitLocker(
- drawingContext->canvas(),
+ drawingCanvas,
ThemeMac::inflateRectForAA(scrollbar->frameRect()),
- drawingContext->deviceScaleFactor());
+ canDrawDirectly ? context->deviceScaleFactor() : 1.0f);
CGContextRef cgContext = bitLocker.cgContext();
HIThemeDrawTrack(&trackInfo, 0, cgContext, kHIThemeOrientationNormal);
@@ -148,7 +150,7 @@ bool ScrollbarThemeMacNonOverlayAPI::paint(ScrollbarThemeClient* scrollbar, Grap
// Inset a bit.
tickmarkTrackRect.setX(tickmarkTrackRect.x() + 2);
tickmarkTrackRect.setWidth(tickmarkTrackRect.width() - 5);
- paintGivenTickmarks(drawingContext, scrollbar, tickmarkTrackRect, tickmarks);
+ paintGivenTickmarks(drawingCanvas, scrollbar, tickmarkTrackRect, tickmarks);
if (!canDrawDirectly) {
ASSERT(imageBuffer);
« no previous file with comments | « Source/platform/scroll/ScrollbarThemeMacCommon.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698