Reviewers: Kasper Lund, Dimitri Glazkov,

Message:
This is the minimal change which needs to go into the V8 bindings to
start using the pixel array data in V8. The pixel array support in V8 is
being added with this change list: http://codereview.chromium.org/159263

I am aware that there are more custom functions which can be removed
eventually, but I left them all in for now to be able to switch back to
the original code quickly.

Thanks for your feedback,
-Ivan



http://codereview.chromium.org/160259/diff/1/2
File bindings/v8/V8DOMWrapper.cpp (right):

http://codereview.chromium.org/160259/diff/1/2#newcode295
Line 295:
//descriptor->InstanceTemplate()->SetIndexedPropertyHandler(USE_INDEXED_PROPERTY_GETTER(CanvasPixelArray),
USE_INDEXED_PROPERTY_SETTER(CanvasPixelArray));
This will be removed before commit, but it helps being here to debug for
now.

http://codereview.chromium.org/160259/diff/1/2#newcode565
Line 565: result->SetElementsToPixelData(pixels->data()->data(),
pixels->length());
I will change the API call in V8 to SetIndexedPropertiesToPixelData to
align the naming with the rest of the API.

Description:
- Bind CanvasPixelArray wrappers to the backing store directly without
   the use of an interceptor.


Please review this at http://codereview.chromium.org/160259

SVN Base: http://svn.webkit.org/repository/webkit/trunk/WebCore/

Affected files:
   M     bindings/v8/V8DOMWrapper.cpp


Index: bindings/v8/V8DOMWrapper.cpp
===================================================================
--- bindings/v8/V8DOMWrapper.cpp        (revision 46194)
+++ bindings/v8/V8DOMWrapper.cpp        (working copy)
@@ -292,7 +292,7 @@
           
descriptor->InstanceTemplate()->SetIndexedPropertyHandler(USE_INDEXED_PROPERTY_GETTER(HTMLFormElement),
  
0, 0, 0, nodeCollectionIndexedPropertyEnumerator<HTMLFormElement>,  
v8::Integer::New(V8ClassIndex::NODE));
          break;
      case V8ClassIndex::CANVASPIXELARRAY:
-         
descriptor->InstanceTemplate()->SetIndexedPropertyHandler(USE_INDEXED_PROPERTY_GETTER(CanvasPixelArray),
  
USE_INDEXED_PROPERTY_SETTER(CanvasPixelArray));
+         
//descriptor->InstanceTemplate()->SetIndexedPropertyHandler(USE_INDEXED_PROPERTY_GETTER(CanvasPixelArray),
  
USE_INDEXED_PROPERTY_SETTER(CanvasPixelArray));
          break;
      case V8ClassIndex::STYLESHEET:  // fall through
      case V8ClassIndex::CSSSTYLESHEET: {
@@ -559,6 +559,11 @@
                  setJSWrapperForActiveDOMObject(impl, result);
              else
                  setJSWrapperForDOMObject(impl, result);
+
+            if (type == V8ClassIndex::CANVASPIXELARRAY) {
+              CanvasPixelArray* pixels =  
reinterpret_cast<CanvasPixelArray*>(impl);
+              result->SetElementsToPixelData(pixels->data()->data(),  
pixels->length());
+            }

              // Special case for non-node objects associated with a
              // DOMWindow. Both Safari and FF let the JS wrappers for these



--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to