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 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 if (m_framebufferBinding || isContextLost()) | 795 if (m_framebufferBinding || isContextLost()) |
796 return; | 796 return; |
797 | 797 |
798 drawingBuffer()->markContentsChanged(); | 798 drawingBuffer()->markContentsChanged(); |
799 | 799 |
800 m_layerCleared = false; | 800 m_layerCleared = false; |
801 RenderBox* renderBox = canvas()->renderBox(); | 801 RenderBox* renderBox = canvas()->renderBox(); |
802 if (renderBox && renderBox->hasAcceleratedCompositing()) { | 802 if (renderBox && renderBox->hasAcceleratedCompositing()) { |
803 m_markedCanvasDirty = true; | 803 m_markedCanvasDirty = true; |
804 canvas()->clearCopiedImage(); | 804 canvas()->clearCopiedImage(); |
805 renderBox->contentChanged(changeType); | 805 IntRect rect = IntRect(IntPoint(0, 0), clampedCanvasSize()); |
| 806 if (!m_flippedScissorBox.isEmpty()) |
| 807 rect.intersect(m_flippedScissorBox); |
| 808 renderBox->contentChanged(changeType, rect); |
806 } else { | 809 } else { |
807 if (!m_markedCanvasDirty) { | 810 if (!m_markedCanvasDirty) { |
808 m_markedCanvasDirty = true; | 811 m_markedCanvasDirty = true; |
809 canvas()->didDraw(FloatRect(FloatPoint(0, 0), clampedCanvasSize())); | 812 canvas()->didDraw(FloatRect(FloatPoint(0, 0), clampedCanvasSize())); |
810 } | 813 } |
811 } | 814 } |
812 } | 815 } |
813 | 816 |
814 bool WebGLRenderingContextBase::clearIfComposited(GLbitfield mask) | 817 bool WebGLRenderingContextBase::clearIfComposited(GLbitfield mask) |
815 { | 818 { |
(...skipping 2416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3232 return; | 3235 return; |
3233 webContext()->sampleCoverage(value, invert); | 3236 webContext()->sampleCoverage(value, invert); |
3234 } | 3237 } |
3235 | 3238 |
3236 void WebGLRenderingContextBase::scissor(GLint x, GLint y, GLsizei width, GLsizei
height) | 3239 void WebGLRenderingContextBase::scissor(GLint x, GLint y, GLsizei width, GLsizei
height) |
3237 { | 3240 { |
3238 if (isContextLost()) | 3241 if (isContextLost()) |
3239 return; | 3242 return; |
3240 if (!validateSize("scissor", width, height)) | 3243 if (!validateSize("scissor", width, height)) |
3241 return; | 3244 return; |
| 3245 |
| 3246 m_flippedScissorBox = IntRect(x, canvas()->height() - height, width, height
- y); |
3242 webContext()->scissor(x, y, width, height); | 3247 webContext()->scissor(x, y, width, height); |
3243 } | 3248 } |
3244 | 3249 |
3245 void WebGLRenderingContextBase::shaderSource(WebGLShader* shader, const String&
string) | 3250 void WebGLRenderingContextBase::shaderSource(WebGLShader* shader, const String&
string) |
3246 { | 3251 { |
3247 if (isContextLost() || !validateWebGLObject("shaderSource", shader)) | 3252 if (isContextLost() || !validateWebGLObject("shaderSource", shader)) |
3248 return; | 3253 return; |
3249 String stringWithoutComments = StripComments(string).result(); | 3254 String stringWithoutComments = StripComments(string).result(); |
3250 if (!validateString("shaderSource", stringWithoutComments)) | 3255 if (!validateString("shaderSource", stringWithoutComments)) |
3251 return; | 3256 return; |
(...skipping 2619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5871 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB
uffer() : 0; | 5876 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB
uffer() : 0; |
5872 } | 5877 } |
5873 #else | 5878 #else |
5874 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const | 5879 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const |
5875 { | 5880 { |
5876 return m_drawingBuffer.get(); | 5881 return m_drawingBuffer.get(); |
5877 } | 5882 } |
5878 #endif | 5883 #endif |
5879 | 5884 |
5880 } // namespace blink | 5885 } // namespace blink |
OLD | NEW |