[Webkit-unassigned] [Bug 69427] HTML canvas strokes with dash and dashOffset for V8.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Oct 23 03:15:13 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=69427





--- Comment #4 from Young Han Lee <joybro201 at gmail.com>  2011-10-23 03:15:13 PST ---
> 
> I think we already have a function that does this.  If we don't have one, you should add it.  It's a very general operation.

To clarify what 'a function that does this' means...

1. Do you mean a function converting Vector<float> to v8:Array?
(e.g. v8::Handle<v8::Value> toV8(const Vector<float>& vector))

This is not a general operation. The patch I uploaded is the only place using the operation, so I don't think we should add the function.


2. Do you mean a function converting any Vector to v8::Array?
(e.g. template <class T> v8::Handle<v8::Value> toV8(const T& vector))

I'm not sure it is possible to generalize this kind of operation.

There are only two places doing this operation under WebCore/bindings/v8, and following is one of them.

typedef Vector<RefPtr<ScriptProfile> > ProfilesArray;

v8::Handle<v8::Value> V8Console::profilesAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    ......
    const ProfilesArray& profiles = imp->profiles();
    ......

    for (ProfilesArray::const_iterator iter = profiles.begin(); iter != end; ++iter)
        result->Set(v8::Integer::New(index++), toV8(iter->get()));
    return result;
}

This function converts the element of the Vector like this 'toV8(iter->get())', because the element is RefPtr. But my patch converts like this 'v8::Number::New(*iter))', because the element is just float.

I don't know a clear way to generalize these two function. Any Idea? 


> 
> Also, per the recent webkit-dev thread, we should be using indicies rather than iterators to walk arrays.  That will also help you avoid the nuttiness of incrementing the iterator and the index at the same time.

agree.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list