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

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

Issue 2565433003: Fix GeneratedImage::drawPattern() use of SkPictureBuilder. (Closed)
Patch Set: Remove old include. Add DCHECK to GC::beginRecording. Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/GeneratedImage.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 257
258 #if DCHECK_IS_ON() 258 #if DCHECK_IS_ON()
259 DCHECK_GT(m_layerCount--, 0); 259 DCHECK_GT(m_layerCount--, 0);
260 #endif 260 #endif
261 } 261 }
262 262
263 void GraphicsContext::beginRecording(const FloatRect& bounds) { 263 void GraphicsContext::beginRecording(const FloatRect& bounds) {
264 if (contextDisabled()) 264 if (contextDisabled())
265 return; 265 return;
266 266
267 DCHECK(!m_canvas);
267 m_canvas = m_pictureRecorder.beginRecording(bounds, nullptr); 268 m_canvas = m_pictureRecorder.beginRecording(bounds, nullptr);
268 if (m_hasMetaData) 269 if (m_hasMetaData)
269 skia::GetMetaData(*m_canvas) = m_metaData; 270 skia::GetMetaData(*m_canvas) = m_metaData;
270 } 271 }
271 272
272 namespace { 273 namespace {
273 274
274 sk_sp<SkPicture> createEmptyPicture() { 275 sk_sp<SkPicture> createEmptyPicture() {
275 SkPictureRecorder recorder; 276 SkPictureRecorder recorder;
276 recorder.beginRecording(SkRect::MakeEmpty(), nullptr); 277 recorder.beginRecording(SkRect::MakeEmpty(), nullptr);
(...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after
1412 static const SkPMColor colors[] = { 1413 static const SkPMColor colors[] = {
1413 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red 1414 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red
1414 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray 1415 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray
1415 }; 1416 };
1416 1417
1417 return colors[index]; 1418 return colors[index];
1418 } 1419 }
1419 #endif 1420 #endif
1420 1421
1421 } // namespace blink 1422 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/GeneratedImage.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698