| OLD | NEW |
| 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 10 matching lines...) Expand all Loading... |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "modules/webgl/WebGLRenderingContextBase.h" | 26 #include "modules/webgl/WebGLRenderingContextBase.h" |
| 27 | 27 |
| 28 #include "bindings/core/v8/ExceptionMessages.h" | 28 #include "bindings/core/v8/ExceptionMessages.h" |
| 29 #include "bindings/core/v8/ExceptionState.h" | 29 #include "bindings/core/v8/ExceptionState.h" |
| 30 #include "bindings/core/v8/V8BindingMacros.h" | 30 #include "bindings/core/v8/V8BindingMacros.h" |
| 31 #include "bindings/modules/v8/HTMLCanvasElementOrOffscreenCanvas.h" |
| 31 #include "bindings/modules/v8/WebGLAny.h" | 32 #include "bindings/modules/v8/WebGLAny.h" |
| 32 #include "core/dom/DOMArrayBuffer.h" | 33 #include "core/dom/DOMArrayBuffer.h" |
| 33 #include "core/dom/DOMTypedArray.h" | 34 #include "core/dom/DOMTypedArray.h" |
| 34 #include "core/dom/FlexibleArrayBufferView.h" | 35 #include "core/dom/FlexibleArrayBufferView.h" |
| 35 #include "core/fetch/ImageResource.h" | 36 #include "core/fetch/ImageResource.h" |
| 36 #include "core/frame/ImageBitmap.h" | 37 #include "core/frame/ImageBitmap.h" |
| 37 #include "core/frame/LocalFrame.h" | 38 #include "core/frame/LocalFrame.h" |
| 38 #include "core/frame/Settings.h" | 39 #include "core/frame/Settings.h" |
| 39 #include "core/html/HTMLCanvasElement.h" | 40 #include "core/html/HTMLCanvasElement.h" |
| 40 #include "core/html/HTMLImageElement.h" | 41 #include "core/html/HTMLImageElement.h" |
| (...skipping 6453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6494 if (m_unpackAlignment != 1) | 6495 if (m_unpackAlignment != 1) |
| 6495 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1); | 6496 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1); |
| 6496 } | 6497 } |
| 6497 | 6498 |
| 6498 void WebGLRenderingContextBase::restoreUnpackParameters() | 6499 void WebGLRenderingContextBase::restoreUnpackParameters() |
| 6499 { | 6500 { |
| 6500 if (m_unpackAlignment != 1) | 6501 if (m_unpackAlignment != 1) |
| 6501 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); | 6502 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
| 6502 } | 6503 } |
| 6503 | 6504 |
| 6505 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas(HTMLCanvasElementOrOffs
creenCanvas& result) const |
| 6506 { |
| 6507 if (canvas()) |
| 6508 result.setHTMLCanvasElement(canvas()); |
| 6509 else |
| 6510 result.setOffscreenCanvas(getOffscreenCanvas()); |
| 6511 } |
| 6512 |
| 6504 } // namespace blink | 6513 } // namespace blink |
| OLD | NEW |