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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 2493673002: Synchronize OffscreenCanvas content with the placeholder canvas (Closed)
Patch Set: fix obsolete test Created 4 years, 1 month 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 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 UseCounter::Feature feature = UseCounter::OffscreenCanvasCommitWebGL; 693 UseCounter::Feature feature = UseCounter::OffscreenCanvasCommitWebGL;
694 UseCounter::count(scriptState->getExecutionContext(), feature); 694 UseCounter::count(scriptState->getExecutionContext(), feature);
695 if (!getOffscreenCanvas()) { 695 if (!getOffscreenCanvas()) {
696 exceptionState.throwDOMException(InvalidStateError, 696 exceptionState.throwDOMException(InvalidStateError,
697 "Commit() was called on a rendering " 697 "Commit() was called on a rendering "
698 "context that was not created from an " 698 "context that was not created from an "
699 "OffscreenCanvas."); 699 "OffscreenCanvas.");
700 return; 700 return;
701 } 701 }
702 // no HTMLCanvas associated, thrown InvalidStateError 702 // no HTMLCanvas associated, thrown InvalidStateError
703 if (getOffscreenCanvas()->getAssociatedCanvasId() == -1) { 703 if (!getOffscreenCanvas()->hasPlaceholderCanvas()) {
704 exceptionState.throwDOMException(InvalidStateError, 704 exceptionState.throwDOMException(InvalidStateError,
705 "Commit() was called on a context whose " 705 "Commit() was called on a context whose "
706 "OffscreenCanvas is not associated with a " 706 "OffscreenCanvas is not associated with a "
707 "canvas element."); 707 "canvas element.");
708 return; 708 return;
709 } 709 }
710 if (!drawingBuffer()) 710 if (!drawingBuffer())
711 return; 711 return;
712 double commitStartTime = WTF::monotonicallyIncreasingTime(); 712 double commitStartTime = WTF::monotonicallyIncreasingTime();
713 // TODO(crbug.com/646864): Make commit() work correctly with 713 // TODO(crbug.com/646864): Make commit() work correctly with
(...skipping 6954 matching lines...) Expand 10 before | Expand all | Expand 10 after
7668 7668
7669 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( 7669 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas(
7670 HTMLCanvasElementOrOffscreenCanvas& result) const { 7670 HTMLCanvasElementOrOffscreenCanvas& result) const {
7671 if (canvas()) 7671 if (canvas())
7672 result.setHTMLCanvasElement(canvas()); 7672 result.setHTMLCanvasElement(canvas());
7673 else 7673 else
7674 result.setOffscreenCanvas(getOffscreenCanvas()); 7674 result.setOffscreenCanvas(getOffscreenCanvas());
7675 } 7675 }
7676 7676
7677 } // namespace blink 7677 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698