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

Side by Side Diff: third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp

Issue 2738573002: Streamline the presentation of ImageBitmapRenderingContext (Closed)
Patch Set: Fix crash in gpu test 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) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 m_canvas = nullptr; 158 m_canvas = nullptr;
159 } 159 }
160 if (offscreenCanvas()) { 160 if (offscreenCanvas()) {
161 offscreenCanvas()->detachContext(); 161 offscreenCanvas()->detachContext();
162 m_offscreenCanvas = nullptr; 162 m_offscreenCanvas = nullptr;
163 } 163 }
164 } 164 }
165 165
166 void CanvasRenderingContext::didDraw(const SkIRect& dirtyRect) { 166 void CanvasRenderingContext::didDraw(const SkIRect& dirtyRect) {
167 canvas()->didDraw(SkRect::Make(dirtyRect)); 167 canvas()->didDraw(SkRect::Make(dirtyRect));
168 scheduleFinalizeFrameIfNeeded();
169 }
170
171 void CanvasRenderingContext::didDraw() {
172 canvas()->didDraw();
173 scheduleFinalizeFrameIfNeeded();
174 }
175
176 void CanvasRenderingContext::scheduleFinalizeFrameIfNeeded() {
168 if (!m_finalizeFrameScheduled) { 177 if (!m_finalizeFrameScheduled) {
169 m_finalizeFrameScheduled = true; 178 m_finalizeFrameScheduled = true;
170 Platform::current()->currentThread()->addTaskObserver(this); 179 Platform::current()->currentThread()->addTaskObserver(this);
171 } 180 }
172 } 181 }
173 182
174 void CanvasRenderingContext::didProcessTask() { 183 void CanvasRenderingContext::didProcessTask() {
175 Platform::current()->currentThread()->removeTaskObserver(this); 184 Platform::current()->currentThread()->removeTaskObserver(this);
176 m_finalizeFrameScheduled = false; 185 m_finalizeFrameScheduled = false;
177 186
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 } 244 }
236 return taintOrigin; 245 return taintOrigin;
237 } 246 }
238 247
239 DEFINE_TRACE(CanvasRenderingContext) { 248 DEFINE_TRACE(CanvasRenderingContext) {
240 visitor->trace(m_canvas); 249 visitor->trace(m_canvas);
241 visitor->trace(m_offscreenCanvas); 250 visitor->trace(m_offscreenCanvas);
242 } 251 }
243 252
244 } // namespace blink 253 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698