Changeset 52700 in webkit


Ignore:
Timestamp:
Jan 3, 2010 6:40:02 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-01-03 Kenneth Russell <kbr@google.com>

Reviewed by Maciej Stachowiak.

Index validation code must always copy client data
https://bugs.webkit.org/show_bug.cgi?id=32748

Client data must always be copied during bufferData and
bufferSubData calls, because otherwise the data the GL uses to
draw may differ from that checked by the index validation code.

  • fast/canvas/webgl/index-validation-copies-indices-expected.txt: Added.
  • fast/canvas/webgl/index-validation-copies-indices.html: Added.

2010-01-03 Kenneth Russell <kbr@google.com>

Reviewed by Maciej Stachowiak.

Index validation code must always copy client data
https://bugs.webkit.org/show_bug.cgi?id=32748

Client data must always be copied during bufferData and
bufferSubData calls, because otherwise the data the GL uses to
draw may differ from that checked by the index validation code.

Test: fast/canvas/webgl/index-validation-copies-indices.html

  • html/canvas/WebGLBuffer.cpp: (WebCore::WebGLBuffer::WebGLBuffer): (WebCore::WebGLBuffer::associateBufferData): (WebCore::WebGLBuffer::associateBufferSubData):
  • html/canvas/WebGLBuffer.h:
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r52697 r52700  
     12010-01-03  Kenneth Russell  <kbr@google.com>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        Index validation code must always copy client data
     6        https://bugs.webkit.org/show_bug.cgi?id=32748
     7
     8        Client data must always be copied during bufferData and
     9        bufferSubData calls, because otherwise the data the GL uses to
     10        draw may differ from that checked by the index validation code.
     11
     12        * fast/canvas/webgl/index-validation-copies-indices-expected.txt: Added.
     13        * fast/canvas/webgl/index-validation-copies-indices.html: Added.
     14
    1152010-01-03  Jakub Wieczorek  <faw217@gmail.com>
    216
  • trunk/WebCore/ChangeLog

    r52699 r52700  
     12010-01-03  Kenneth Russell  <kbr@google.com>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        Index validation code must always copy client data
     6        https://bugs.webkit.org/show_bug.cgi?id=32748
     7
     8        Client data must always be copied during bufferData and
     9        bufferSubData calls, because otherwise the data the GL uses to
     10        draw may differ from that checked by the index validation code.
     11
     12        Test: fast/canvas/webgl/index-validation-copies-indices.html
     13
     14        * html/canvas/WebGLBuffer.cpp:
     15        (WebCore::WebGLBuffer::WebGLBuffer):
     16        (WebCore::WebGLBuffer::associateBufferData):
     17        (WebCore::WebGLBuffer::associateBufferSubData):
     18        * html/canvas/WebGLBuffer.h:
     19
    1202010-01-03  Adam Barth  <abarth@webkit.org>
    221
  • trunk/WebCore/html/canvas/WebGLBuffer.cpp

    r52205 r52700  
    4747    , m_elementArrayBufferByteLength(0)
    4848    , m_arrayBufferByteLength(0)
    49     , m_elementArrayBufferCloned(false)
    5049    , m_nextAvailableCacheEntry(0)
    5150{
     
    9089        clearCachedMaxIndices();
    9190        m_elementArrayBufferByteLength = array->byteLength();
    92         m_elementArrayBuffer = array->buffer();
    93         m_elementArrayBufferCloned = false;
     91        // We must always clone the incoming data because client-side
     92        // modifications without calling bufferData or bufferSubData
     93        // must never be able to change the validation results.
     94        m_elementArrayBuffer = WebGLArrayBuffer::create(array->buffer().get());
    9495        return true;
    9596    }
     
    118119        if (uoffset > m_elementArrayBufferByteLength || array->byteLength() > m_elementArrayBufferByteLength - uoffset)
    119120            return false;
    120            
    121         // If we already have a buffer, we need to clone it and add the new data
    122         if (m_elementArrayBuffer && !m_elementArrayBufferCloned) {
    123             m_elementArrayBuffer = WebGLArrayBuffer::create(m_elementArrayBuffer.get());
    124             m_elementArrayBufferCloned = true;
    125         }
    126121           
    127122        memcpy(static_cast<unsigned char*>(m_elementArrayBuffer->data()) + offset, array->baseAddress(), array->byteLength());
  • trunk/WebCore/html/canvas/WebGLBuffer.h

    r52205 r52700  
    6868        unsigned m_elementArrayBufferByteLength;
    6969        unsigned m_arrayBufferByteLength;
    70         bool m_elementArrayBufferCloned;
    7170
    7271        // Optimization for index validation. For each type of index
Note: See TracChangeset for help on using the changeset viewer.