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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp

Issue 2752593002: cc: Make PaintCanvas abstract (Closed)
Patch Set: Remove default parameters on virtual functions Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 m_metaData = *metaData; 75 m_metaData = *metaData;
76 76
77 // FIXME: Do some tests to determine how many states are typically used, and 77 // FIXME: Do some tests to determine how many states are typically used, and
78 // allocate several here. 78 // allocate several here.
79 m_paintStateStack.push_back(GraphicsContextState::create()); 79 m_paintStateStack.push_back(GraphicsContextState::create());
80 m_paintState = m_paintStateStack.back().get(); 80 m_paintState = m_paintStateStack.back().get();
81 81
82 if (contextDisabled()) { 82 if (contextDisabled()) {
83 DEFINE_STATIC_LOCAL(SkCanvas*, nullSkCanvas, 83 DEFINE_STATIC_LOCAL(SkCanvas*, nullSkCanvas,
84 (SkMakeNullCanvas().release())); 84 (SkMakeNullCanvas().release()));
85 DEFINE_STATIC_LOCAL(PaintCanvas, nullCanvas, (nullSkCanvas)); 85 DEFINE_STATIC_LOCAL(SkiaPaintCanvas, nullCanvas, (nullSkCanvas));
86 m_canvas = &nullCanvas; 86 m_canvas = &nullCanvas;
87 } 87 }
88 } 88 }
89 89
90 GraphicsContext::~GraphicsContext() { 90 GraphicsContext::~GraphicsContext() {
91 #if DCHECK_IS_ON() 91 #if DCHECK_IS_ON()
92 if (!m_disableDestructionChecks) { 92 if (!m_disableDestructionChecks) {
93 DCHECK(!m_paintStateIndex); 93 DCHECK(!m_paintStateIndex);
94 DCHECK(!m_paintState->saveCount()); 94 DCHECK(!m_paintState->saveCount());
95 DCHECK(!m_layerCount); 95 DCHECK(!m_layerCount);
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 break; 1347 break;
1348 default: 1348 default:
1349 NOTREACHED(); 1349 NOTREACHED();
1350 break; 1350 break;
1351 } 1351 }
1352 1352
1353 return nullptr; 1353 return nullptr;
1354 } 1354 }
1355 1355
1356 } // namespace blink 1356 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698