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

Side by Side Diff: Source/platform/graphics/GraphicsContextCullSaver.h

Issue 204093002: GraphicsContext culling support. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Drop GC cull stack, misc fixes. Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/platform/graphics/GraphicsContext.cpp ('k') | Source/web/WebSettingsImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #ifndef GraphicsContextCullSaver_h
2 #define GraphicsContextCullSaver_h
3
4 #include "platform/PlatformExport.h"
5 #include "platform/graphics/GraphicsContext.h"
6
7 namespace WebCore {
8
9 class FloatRect;
10
11 class PLATFORM_EXPORT GraphicsContextCullSaver {
Stephen Chennney 2014/03/21 19:44:20 You don't need this for a fully inlined class.
12 WTF_MAKE_FAST_ALLOCATED;
13 public:
14 GraphicsContextCullSaver(GraphicsContext& context)
15 : m_context(context)
16 , m_cullApplied(false)
17 {
18 }
19
20 GraphicsContextCullSaver(GraphicsContext& context, const FloatRect& rect)
21 : m_context(context)
22 , m_cullApplied(true)
23 {
24 context.beginCull(rect);
25 }
26
27 ~GraphicsContextCullSaver()
28 {
29 if (m_cullApplied)
30 m_context.endCull();
31 }
32
33 void cull(const FloatRect& rect)
34 {
35 ASSERT(!m_cullApplied);
36 m_context.beginCull(rect);
37 m_cullApplied = true;
38 }
39
40 private:
41 GraphicsContext& m_context;
42 bool m_cullApplied;
43 };
44
45 } // namespace WebCore
46
47 #endif // GraphicsContextCullSaver_h
OLDNEW
« no previous file with comments | « Source/platform/graphics/GraphicsContext.cpp ('k') | Source/web/WebSettingsImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698