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

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

Issue 2705723002: Convert SkiaBitLocker to use PaintCanvas (Closed)
Patch Set: Remove rogue cc:: Created 3 years, 10 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) 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
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details. 12 * Library General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU Library General Public License 14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to 15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA. 17 * Boston, MA 02110-1301, USA.
18 */ 18 */
19 19
20 #include "platform/PlatformExport.h" 20 #include "platform/PlatformExport.h"
21 #include "platform/geometry/IntRect.h" 21 #include "platform/geometry/IntRect.h"
22 #include "platform/graphics/paint/PaintCanvas.h" 22 #include "platform/graphics/paint/PaintCanvas.h"
23 #include "skia/ext/skia_utils_mac.h" 23 #include "platform/mac/GraphicsContextCanvas.h"
24 #include "wtf/Noncopyable.h" 24 #include "wtf/Noncopyable.h"
25 25
26 OBJC_CLASS NSGraphicsContext; 26 OBJC_CLASS NSGraphicsContext;
27 27
28 namespace blink { 28 namespace blink {
29 29
30 class GraphicsContext; 30 class GraphicsContext;
31 31
32 // This class automatically saves and restores the current NSGraphicsContext for 32 // This class automatically saves and restores the current NSGraphicsContext for
33 // functions which call out into AppKit and rely on the currentContext being set 33 // functions which call out into AppKit and rely on the currentContext being set
34 class PLATFORM_EXPORT LocalCurrentGraphicsContext { 34 class PLATFORM_EXPORT LocalCurrentGraphicsContext {
35 WTF_MAKE_NONCOPYABLE(LocalCurrentGraphicsContext); 35 WTF_MAKE_NONCOPYABLE(LocalCurrentGraphicsContext);
36 36
37 public: 37 public:
38 LocalCurrentGraphicsContext(GraphicsContext&, const IntRect& dirtyRect); 38 LocalCurrentGraphicsContext(GraphicsContext&, const IntRect& dirtyRect);
39 LocalCurrentGraphicsContext(PaintCanvas*, 39 LocalCurrentGraphicsContext(PaintCanvas*,
40 float deviceScaleFactor, 40 float deviceScaleFactor,
41 const IntRect& dirtyRect); 41 const IntRect& dirtyRect);
42 ~LocalCurrentGraphicsContext(); 42 ~LocalCurrentGraphicsContext();
43 CGContextRef cgContext(); 43 CGContextRef cgContext();
44 44
45 private: 45 private:
46 PaintCanvas* m_savedCanvas; 46 PaintCanvas* m_savedCanvas;
47 NSGraphicsContext* m_savedNSGraphicsContext; 47 NSGraphicsContext* m_savedNSGraphicsContext;
48 bool m_didSetGraphicsContext; 48 bool m_didSetGraphicsContext;
49 IntRect m_inflatedDirtyRect; 49 IntRect m_inflatedDirtyRect;
50 skia::SkiaBitLocker m_skiaBitLocker; 50 GraphicsContextCanvas m_graphicsContextCanvas;
51 }; 51 };
52 } 52 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698