| 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 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1125 CreationAttributes().preserveDrawingBuffer() ? DrawingBuffer::kPreserve | 1125 CreationAttributes().preserveDrawingBuffer() ? DrawingBuffer::kPreserve |
| 1126 : DrawingBuffer::kDiscard; | 1126 : DrawingBuffer::kDiscard; |
| 1127 DrawingBuffer::WebGLVersion web_gl_version = DrawingBuffer::kWebGL1; | 1127 DrawingBuffer::WebGLVersion web_gl_version = DrawingBuffer::kWebGL1; |
| 1128 if (Version() == 1) { | 1128 if (Version() == 1) { |
| 1129 web_gl_version = DrawingBuffer::kWebGL1; | 1129 web_gl_version = DrawingBuffer::kWebGL1; |
| 1130 } else if (Version() == 2) { | 1130 } else if (Version() == 2) { |
| 1131 web_gl_version = DrawingBuffer::kWebGL2; | 1131 web_gl_version = DrawingBuffer::kWebGL2; |
| 1132 } else { | 1132 } else { |
| 1133 NOTREACHED(); | 1133 NOTREACHED(); |
| 1134 } | 1134 } |
| 1135 return DrawingBuffer::Create(std::move(context_provider), this, | 1135 return DrawingBuffer::Create( |
| 1136 ClampedCanvasSize(), premultiplied_alpha, | 1136 std::move(context_provider), this, ClampedCanvasSize(), |
| 1137 want_alpha_channel, want_depth_buffer, | 1137 premultiplied_alpha, want_alpha_channel, want_depth_buffer, |
| 1138 want_stencil_buffer, want_antialiasing, preserve, | 1138 want_stencil_buffer, want_antialiasing, preserve, web_gl_version, |
| 1139 web_gl_version, chromium_image_usage); | 1139 chromium_image_usage, color_params()); |
| 1140 } | 1140 } |
| 1141 | 1141 |
| 1142 void WebGLRenderingContextBase::InitializeNewContext() { | 1142 void WebGLRenderingContextBase::InitializeNewContext() { |
| 1143 ASSERT(!isContextLost()); | 1143 ASSERT(!isContextLost()); |
| 1144 ASSERT(GetDrawingBuffer()); | 1144 ASSERT(GetDrawingBuffer()); |
| 1145 | 1145 |
| 1146 marked_canvas_dirty_ = false; | 1146 marked_canvas_dirty_ = false; |
| 1147 animation_frame_in_progress_ = false; | 1147 animation_frame_in_progress_ = false; |
| 1148 active_texture_unit_ = 0; | 1148 active_texture_unit_ = 0; |
| 1149 pack_alignment_ = 4; | 1149 pack_alignment_ = 4; |
| (...skipping 6712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7862 | 7862 |
| 7863 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( | 7863 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( |
| 7864 HTMLCanvasElementOrOffscreenCanvas& result) const { | 7864 HTMLCanvasElementOrOffscreenCanvas& result) const { |
| 7865 if (canvas()) | 7865 if (canvas()) |
| 7866 result.setHTMLCanvasElement(canvas()); | 7866 result.setHTMLCanvasElement(canvas()); |
| 7867 else | 7867 else |
| 7868 result.setOffscreenCanvas(offscreenCanvas()); | 7868 result.setOffscreenCanvas(offscreenCanvas()); |
| 7869 } | 7869 } |
| 7870 | 7870 |
| 7871 } // namespace blink | 7871 } // namespace blink |
| OLD | NEW |