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

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

Issue 1823133002: Use sk_sp-based picture recording APIs in Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 m_canvas = m_pictureRecorder.beginRecording(bounds, 0); 301 m_canvas = m_pictureRecorder.beginRecording(bounds, 0);
302 if (m_hasMetaData) 302 if (m_hasMetaData)
303 skia::GetMetaData(*m_canvas) = m_metaData; 303 skia::GetMetaData(*m_canvas) = m_metaData;
304 } 304 }
305 305
306 PassRefPtr<SkPicture> GraphicsContext::endRecording() 306 PassRefPtr<SkPicture> GraphicsContext::endRecording()
307 { 307 {
308 if (contextDisabled()) 308 if (contextDisabled())
309 return nullptr; 309 return nullptr;
310 310
311 RefPtr<SkPicture> picture = adoptRef(m_pictureRecorder.endRecordingAsPicture ()); 311 RefPtr<SkPicture> picture = fromSkSp(m_pictureRecorder.finishRecordingAsPict ure());
312 m_canvas = nullptr; 312 m_canvas = nullptr;
313 ASSERT(picture); 313 ASSERT(picture);
314 return picture.release(); 314 return picture.release();
315 } 315 }
316 316
317 void GraphicsContext::drawPicture(const SkPicture* picture) 317 void GraphicsContext::drawPicture(const SkPicture* picture)
318 { 318 {
319 if (contextDisabled() || !picture || picture->cullRect().isEmpty()) 319 if (contextDisabled() || !picture || picture->cullRect().isEmpty())
320 return; 320 return;
321 321
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after
1359 static const SkPMColor colors[] = { 1359 static const SkPMColor colors[] = {
1360 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red 1360 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red
1361 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray 1361 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray
1362 }; 1362 };
1363 1363
1364 return colors[index]; 1364 return colors[index];
1365 } 1365 }
1366 #endif 1366 #endif
1367 1367
1368 } // namespace blink 1368 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698