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

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

Issue 1220583004: Refactor DrawingRecorders to check for cached drawings earlier (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix some !'s and &&'s. De Morgan would be proud. Created 5 years, 5 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 // 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 #include "config.h" 5 #include "config.h"
6 #include "web/WebGraphicsContextImpl.h" 6 #include "web/WebGraphicsContextImpl.h"
7 7
8 #include "platform/graphics/GraphicsContext.h" 8 #include "platform/graphics/GraphicsContext.h"
9 #include "platform/graphics/paint/DrawingRecorder.h" 9 #include "platform/graphics/paint/DrawingRecorder.h"
10 10
(...skipping 12 matching lines...) Expand all
23 WebGraphicsContextImpl::~WebGraphicsContextImpl() 23 WebGraphicsContextImpl::~WebGraphicsContextImpl()
24 { 24 {
25 } 25 }
26 26
27 WebCanvas* WebGraphicsContextImpl::beginDrawing(const WebFloatRect& bounds) 27 WebCanvas* WebGraphicsContextImpl::beginDrawing(const WebFloatRect& bounds)
28 { 28 {
29 #ifndef NDEBUG 29 #ifndef NDEBUG
30 ASSERT(!m_hasBegunDrawing); 30 ASSERT(!m_hasBegunDrawing);
31 m_hasBegunDrawing = true; 31 m_hasBegunDrawing = true;
32 #endif 32 #endif
33 ASSERT(!DrawingRecorder::useCachedDrawingIfPossible(m_graphicsContext, m_cli ent, m_type));
33 m_drawingRecorder = adoptPtr(new DrawingRecorder(m_graphicsContext, m_client , m_type, bounds)); 34 m_drawingRecorder = adoptPtr(new DrawingRecorder(m_graphicsContext, m_client , m_type, bounds));
34
35 ASSERT(!m_drawingRecorder->canUseCachedDrawing());
36
37 WebCanvas* canvas = m_graphicsContext.canvas(); 35 WebCanvas* canvas = m_graphicsContext.canvas();
38 ASSERT(canvas); 36 ASSERT(canvas);
39 return canvas; 37 return canvas;
40 } 38 }
41 39
42 void WebGraphicsContextImpl::endDrawing() 40 void WebGraphicsContextImpl::endDrawing()
43 { 41 {
44 ASSERT(m_drawingRecorder); 42 ASSERT(m_drawingRecorder);
45 m_drawingRecorder.clear(); 43 m_drawingRecorder.clear();
46 } 44 }
47 45
48 } // namespace blink 46 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698