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

Side by Side Diff: Source/web/WebGraphicsContextImpl.h

Issue 1328773002: Make classes and structures in web fast-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « Source/web/WebFontImpl.h ('k') | Source/web/WebInputEventConversion.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef WebGraphicsContextImpl_h 5 #ifndef WebGraphicsContextImpl_h
6 #define WebGraphicsContextImpl_h 6 #define WebGraphicsContextImpl_h
7 7
8 #include "platform/graphics/paint/DisplayItem.h" 8 #include "platform/graphics/paint/DisplayItem.h"
9 #include "platform/graphics/paint/DisplayItemClient.h" 9 #include "platform/graphics/paint/DisplayItemClient.h"
10 #include "public/web/WebGraphicsContext.h" 10 #include "public/web/WebGraphicsContext.h"
11 #include "wtf/Allocator.h"
11 #include "wtf/OwnPtr.h" 12 #include "wtf/OwnPtr.h"
12 13
13 namespace blink { 14 namespace blink {
14 15
15 class DrawingRecorder; 16 class DrawingRecorder;
16 class GraphicsContext; 17 class GraphicsContext;
17 18
18 // Wraps a blink::GraphicsContext. 19 // Wraps a blink::GraphicsContext.
19 // Internal consumers can extract the underlying context (via WebGraphicsContext Impl). 20 // Internal consumers can extract the underlying context (via WebGraphicsContext Impl).
20 // External consumers can make a single drawing using a WebCanvas. 21 // External consumers can make a single drawing using a WebCanvas.
21 class WebGraphicsContextImpl : public WebGraphicsContext { 22 class WebGraphicsContextImpl final : public WebGraphicsContext {
23 DISALLOW_ALLOCATION();
22 public: 24 public:
23 WebGraphicsContextImpl(GraphicsContext&, const DisplayItemClientWrapper&, Di splayItem::Type); 25 WebGraphicsContextImpl(GraphicsContext&, const DisplayItemClientWrapper&, Di splayItem::Type);
24 ~WebGraphicsContextImpl(); 26 ~WebGraphicsContextImpl();
25 GraphicsContext& graphicsContext() { return m_graphicsContext; } 27 GraphicsContext& graphicsContext() { return m_graphicsContext; }
26 28
27 // blink::WebGraphicsContext 29 // blink::WebGraphicsContext
28 WebCanvas* beginDrawing(const WebFloatRect& bounds) override; 30 WebCanvas* beginDrawing(const WebFloatRect& bounds) override;
29 void endDrawing() override; 31 void endDrawing() override;
30 32
31 private: 33 private:
32 GraphicsContext& m_graphicsContext; 34 GraphicsContext& m_graphicsContext;
33 DisplayItemClientWrapper m_client; 35 DisplayItemClientWrapper m_client;
34 DisplayItem::Type m_type; 36 DisplayItem::Type m_type;
35 OwnPtr<DrawingRecorder> m_drawingRecorder; 37 OwnPtr<DrawingRecorder> m_drawingRecorder;
36 #ifndef NDEBUG 38 #ifndef NDEBUG
37 bool m_hasBegunDrawing; 39 bool m_hasBegunDrawing;
38 #endif 40 #endif
39 }; 41 };
40 42
41 // Source/web/ assumes that WebGraphicsContextImpl is the only implementation. 43 // Source/web/ assumes that WebGraphicsContextImpl is the only implementation.
42 DEFINE_TYPE_CASTS(WebGraphicsContextImpl, WebGraphicsContext, webGraphicsContext , true, true); 44 DEFINE_TYPE_CASTS(WebGraphicsContextImpl, WebGraphicsContext, webGraphicsContext , true, true);
43 45
44 } // namespace blink 46 } // namespace blink
45 47
46 #endif 48 #endif
OLDNEW
« no previous file with comments | « Source/web/WebFontImpl.h ('k') | Source/web/WebInputEventConversion.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698