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

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: Flag disabled by default. 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/graphics/GraphicsContext.h"
5
6 namespace WebCore {
7
8 class FloatRect;
9
10 class GraphicsContextCullSaver {
11 WTF_MAKE_FAST_ALLOCATED;
12 public:
13 GraphicsContextCullSaver(GraphicsContext& context)
14 : m_context(context)
15 , m_cullApplied(false)
16 {
17 }
18
19 GraphicsContextCullSaver(GraphicsContext& context, const FloatRect& rect)
20 : m_context(context)
21 , m_cullApplied(true)
22 {
23 context.beginCull(rect);
24 }
25
26 ~GraphicsContextCullSaver()
27 {
28 if (m_cullApplied)
29 m_context.endCull();
30 }
31
32 void cull(const FloatRect& rect)
33 {
34 ASSERT(!m_cullApplied);
35 m_context.beginCull(rect);
36 m_cullApplied = true;
37 }
38
39 private:
40 GraphicsContext& m_context;
41 bool m_cullApplied;
42 };
43
44 } // namespace WebCore
45
46 #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