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

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

Issue 2686033005: Move metafile printing code from platform canvas to PaintCanvas (Closed)
Patch Set: Created 3 years, 10 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 #endif 265 #endif
266 } 266 }
267 267
268 void GraphicsContext::beginRecording(const FloatRect& bounds) { 268 void GraphicsContext::beginRecording(const FloatRect& bounds) {
269 if (contextDisabled()) 269 if (contextDisabled())
270 return; 270 return;
271 271
272 DCHECK(!m_canvas); 272 DCHECK(!m_canvas);
273 m_canvas = m_pictureRecorder.beginRecording(bounds, nullptr); 273 m_canvas = m_pictureRecorder.beginRecording(bounds, nullptr);
274 if (m_hasMetaData) 274 if (m_hasMetaData)
275 skia::GetMetaData(*m_canvas) = m_metaData; 275 m_canvas->getMetaData() = m_metaData;
276 } 276 }
277 277
278 namespace { 278 namespace {
279 279
280 sk_sp<PaintRecord> createEmptyPicture() { 280 sk_sp<PaintRecord> createEmptyPicture() {
281 PaintRecorder recorder; 281 PaintRecorder recorder;
282 recorder.beginRecording(SkRect::MakeEmpty(), nullptr); 282 recorder.beginRecording(SkRect::MakeEmpty(), nullptr);
283 return recorder.finishRecordingAsPicture(); 283 return recorder.finishRecordingAsPicture();
284 } 284 }
285 285
(...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after
1343 break; 1343 break;
1344 default: 1344 default:
1345 ASSERT_NOT_REACHED(); 1345 ASSERT_NOT_REACHED();
1346 break; 1346 break;
1347 } 1347 }
1348 1348
1349 return nullptr; 1349 return nullptr;
1350 } 1350 }
1351 1351
1352 } // namespace blink 1352 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698