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

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

Issue 2743363006: Clean up cc/paint interfaces (Closed)
Patch Set: Rebase 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 (createEmptyPaintRecord())); 290 (createEmptyPaintRecord()));
291 return emptyPaintRecord; 291 return emptyPaintRecord;
292 } 292 }
293 293
294 sk_sp<PaintRecord> record = m_paintRecorder.finishRecordingAsPicture(); 294 sk_sp<PaintRecord> record = m_paintRecorder.finishRecordingAsPicture();
295 m_canvas = nullptr; 295 m_canvas = nullptr;
296 DCHECK(record); 296 DCHECK(record);
297 return record; 297 return record;
298 } 298 }
299 299
300 void GraphicsContext::drawRecord(const PaintRecord* record) { 300 void GraphicsContext::drawRecord(sk_sp<const PaintRecord> record) {
301 if (contextDisabled() || !record || record->cullRect().isEmpty()) 301 if (contextDisabled() || !record || record->cullRect().isEmpty())
302 return; 302 return;
303 303
304 DCHECK(m_canvas); 304 DCHECK(m_canvas);
305 m_canvas->drawPicture(record); 305 m_canvas->drawPicture(record);
danakj 2017/03/16 20:06:16 move()
306 } 306 }
307 307
308 void GraphicsContext::compositeRecord(sk_sp<PaintRecord> record, 308 void GraphicsContext::compositeRecord(sk_sp<PaintRecord> record,
309 const FloatRect& dest, 309 const FloatRect& dest,
310 const FloatRect& src, 310 const FloatRect& src,
311 SkBlendMode op) { 311 SkBlendMode op) {
312 if (contextDisabled() || !record) 312 if (contextDisabled() || !record)
313 return; 313 return;
314 DCHECK(m_canvas); 314 DCHECK(m_canvas);
315 315
(...skipping 1031 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