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

Side by Side Diff: third_party/WebKit/Source/web/PageWidgetDelegate.cpp

Issue 1841833002: Deal gracefully with null {GraphicsContext,SkPictureBuilder}.endRecording() results. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't end recording twice in DrawingRecorder. Created 4 years, 8 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 FrameView* view = root.view(); 86 FrameView* view = root.view();
87 if (view) { 87 if (view) {
88 ClipRecorder clipRecorder(paintContext, root, DisplayItem::PageWidge tDelegateClip, LayoutRect(dirtyRect)); 88 ClipRecorder clipRecorder(paintContext, root, DisplayItem::PageWidge tDelegateClip, LayoutRect(dirtyRect));
89 89
90 view->paint(paintContext, globalPaintFlags, CullRect(dirtyRect)); 90 view->paint(paintContext, globalPaintFlags, CullRect(dirtyRect));
91 } else if (!DrawingRecorder::useCachedDrawingIfPossible(paintContext, ro ot, DisplayItem::PageWidgetDelegateBackgroundFallback)) { 91 } else if (!DrawingRecorder::useCachedDrawingIfPossible(paintContext, ro ot, DisplayItem::PageWidgetDelegateBackgroundFallback)) {
92 DrawingRecorder drawingRecorder(paintContext, root, DisplayItem::Pag eWidgetDelegateBackgroundFallback, dirtyRect); 92 DrawingRecorder drawingRecorder(paintContext, root, DisplayItem::Pag eWidgetDelegateBackgroundFallback, dirtyRect);
93 paintContext.fillRect(dirtyRect, Color::white); 93 paintContext.fillRect(dirtyRect, Color::white);
94 } 94 }
95 } 95 }
96 pictureBuilder.endRecording()->playback(canvas); 96 RefPtr<const SkPicture> recording = pictureBuilder.endRecording();
97 if (recording)
98 recording->playback(canvas);
97 } 99 }
98 100
99 void PageWidgetDelegate::paint(Page& page, WebCanvas* canvas, 101 void PageWidgetDelegate::paint(Page& page, WebCanvas* canvas,
100 const WebRect& rect, LocalFrame& root) 102 const WebRect& rect, LocalFrame& root)
101 { 103 {
102 paintInternal(page, canvas, rect, root, GlobalPaintNormalPhase); 104 paintInternal(page, canvas, rect, root, GlobalPaintNormalPhase);
103 } 105 }
104 106
105 void PageWidgetDelegate::paintIgnoringCompositing(Page& page, WebCanvas* canvas, 107 void PageWidgetDelegate::paintIgnoringCompositing(Page& page, WebCanvas* canvas,
106 const WebRect& rect, LocalFrame& root) 108 const WebRect& rect, LocalFrame& root)
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 WEBINPUT_EVENT_CASE(TouchMove) 255 WEBINPUT_EVENT_CASE(TouchMove)
254 WEBINPUT_EVENT_CASE(TouchEnd) 256 WEBINPUT_EVENT_CASE(TouchEnd)
255 WEBINPUT_EVENT_CASE(TouchCancel) 257 WEBINPUT_EVENT_CASE(TouchCancel)
256 default: 258 default:
257 ASSERT_NOT_REACHED(); 259 ASSERT_NOT_REACHED();
258 return ""; 260 return "";
259 } 261 }
260 } 262 }
261 263
262 } // namespace blink 264 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698