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

Side by Side Diff: third_party/WebKit/Source/web/WebGraphicsContextImpl.cpp

Issue 1412593003: Remove WebGraphicsContext/WebGraphicsContextImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove another include WebGraphicsContext.h Created 5 years, 1 month 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "web/WebGraphicsContextImpl.h"
7
8 #include "platform/graphics/GraphicsContext.h"
9 #include "platform/graphics/paint/DrawingRecorder.h"
10
11 namespace blink {
12
13 WebGraphicsContextImpl::WebGraphicsContextImpl(GraphicsContext& graphicsContext, const DisplayItemClientWrapper& client, DisplayItem::Type type)
14 : m_graphicsContext(graphicsContext)
15 , m_client(client)
16 , m_type(type)
17 #ifndef NDEBUG
18 , m_hasBegunDrawing(false)
19 #endif
20 {
21 }
22
23 WebGraphicsContextImpl::~WebGraphicsContextImpl()
24 {
25 }
26
27 WebCanvas* WebGraphicsContextImpl::beginDrawing(const WebFloatRect& bounds)
28 {
29 #ifndef NDEBUG
30 ASSERT(!m_hasBegunDrawing);
31 m_hasBegunDrawing = true;
32 #endif
33 ASSERT(!DrawingRecorder::useCachedDrawingIfPossible(m_graphicsContext, m_cli ent, m_type));
34 m_drawingRecorder = adoptPtr(new DrawingRecorder(m_graphicsContext, m_client , m_type, bounds));
35 WebCanvas* canvas = m_graphicsContext.canvas();
36 ASSERT(canvas);
37 return canvas;
38 }
39
40 void WebGraphicsContextImpl::endDrawing()
41 {
42 ASSERT(m_drawingRecorder);
43 m_drawingRecorder.clear();
44 }
45
46 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698