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

Side by Side Diff: third_party/WebKit/Source/platform/mac/LocalCurrentGraphicsContext.mm

Issue 1512803004: Use refs for GraphicsContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarTheme
Patch Set: Created 5 years 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 Apple Computer, Inc. 2 * Copyright (C) 2006 Apple Computer, Inc.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 10 matching lines...) Expand all
21 21
22 #include "platform/mac/LocalCurrentGraphicsContext.h" 22 #include "platform/mac/LocalCurrentGraphicsContext.h"
23 #include "platform/mac/ThemeMac.h" 23 #include "platform/mac/ThemeMac.h"
24 24
25 #include <AppKit/NSGraphicsContext.h> 25 #include <AppKit/NSGraphicsContext.h>
26 #include "platform/graphics/GraphicsContext.h" 26 #include "platform/graphics/GraphicsContext.h"
27 #include "platform_canvas.h" 27 #include "platform_canvas.h"
28 28
29 namespace blink { 29 namespace blink {
30 30
31 LocalCurrentGraphicsContext::LocalCurrentGraphicsContext(GraphicsContext* graphi csContext, const IntRect& dirtyRect) 31 LocalCurrentGraphicsContext::LocalCurrentGraphicsContext(GraphicsContext& graphi csContext, const IntRect& dirtyRect)
32 : LocalCurrentGraphicsContext(graphicsContext->canvas(), graphicsContext->de viceScaleFactor(), nullptr, dirtyRect) 32 : LocalCurrentGraphicsContext(graphicsContext.canvas(), graphicsContext.devi ceScaleFactor(), nullptr, dirtyRect)
33 { 33 {
34 } 34 }
35 35
36 LocalCurrentGraphicsContext::LocalCurrentGraphicsContext(GraphicsContext* graphi csContext, const IntRect* interestRect, 36 LocalCurrentGraphicsContext::LocalCurrentGraphicsContext(GraphicsContext& graphi csContext, const IntRect* interestRect,
37 const IntRect& dirtyRec t) 37 const IntRect& dirtyRec t)
38 : LocalCurrentGraphicsContext(graphicsContext->canvas(), graphicsContext->de viceScaleFactor(), interestRect, dirtyRect) 38 : LocalCurrentGraphicsContext(graphicsContext.canvas(), graphicsContext.devi ceScaleFactor(), interestRect, dirtyRect)
39 { 39 {
40 } 40 }
41 41
42 LocalCurrentGraphicsContext::LocalCurrentGraphicsContext(SkCanvas* canvas, float deviceScaleFactor, const IntRect* interestRect, 42 LocalCurrentGraphicsContext::LocalCurrentGraphicsContext(SkCanvas* canvas, float deviceScaleFactor, const IntRect* interestRect,
43 const IntRect& dirtyRec t) 43 const IntRect& dirtyRec t)
44 : m_didSetGraphicsContext(false) 44 : m_didSetGraphicsContext(false)
45 , m_inflatedDirtyRect(ThemeMac::inflateRectForAA(dirtyRect)) 45 , m_inflatedDirtyRect(ThemeMac::inflateRectForAA(dirtyRect))
46 , m_skiaBitLocker(canvas, 46 , m_skiaBitLocker(canvas,
47 m_inflatedDirtyRect, 47 m_inflatedDirtyRect,
48 deviceScaleFactor) 48 deviceScaleFactor)
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 CGContextRef LocalCurrentGraphicsContext::cgContext() 82 CGContextRef LocalCurrentGraphicsContext::cgContext()
83 { 83 {
84 // This synchronizes the CGContext to reflect the current SkCanvas state. 84 // This synchronizes the CGContext to reflect the current SkCanvas state.
85 // The implementation may not return the same CGContext each time. 85 // The implementation may not return the same CGContext each time.
86 CGContextRef cgContext = m_skiaBitLocker.cgContext(); 86 CGContextRef cgContext = m_skiaBitLocker.cgContext();
87 87
88 return cgContext; 88 return cgContext;
89 } 89 }
90 90
91 } 91 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698