Bug 52339 - Remove sizeInBytes from GraphicsContext3D's various implementations
Summary: Remove sizeInBytes from GraphicsContext3D's various implementations
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Zhenyao Mo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-12 17:12 PST by Zhenyao Mo
Modified: 2011-01-24 14:42 PST (History)
3 users (show)

See Also:


Attachments
Patch (6.85 KB, patch)
2011-01-24 14:30 PST, Zhenyao Mo
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zhenyao Mo 2011-01-12 17:12:09 PST
Since we defined CG3D types to match GL types, we can just use that to implement sizeInBytes instead.

Maybe we could just remove this function from GraphicsContext3D and just implement it on the WebGLRenderingContext side.
Comment 1 Zhenyao Mo 2011-01-24 14:30:22 PST
Created attachment 79978 [details]
Patch
Comment 2 Zhenyao Mo 2011-01-24 14:31:38 PST
(In reply to comment #1)
> Created an attachment (id=79978) [details]
> Patch

Note that we didn't remove sizeInBytes from WebGraphicsContext3D.  We can do it in 51947.
Comment 3 Darin Adler 2011-01-24 14:32:39 PST
Comment on attachment 79978 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=79978&action=review

> Source/WebCore/html/canvas/WebGLRenderingContext.cpp:506
> +    default:
> +        return 0;

Normally we leave defaults out of our switch statements to allow the compiler to check that we covered all the enum values. Then, outside the switch we put something like this:

    ASSERT_NOT_REACHED();
    return 0;

Because it’s not correct for someone to pass in a value that is not one of the enum constants.
Comment 4 Zhenyao Mo 2011-01-24 14:33:53 PST
(In reply to comment #3)
> (From update of attachment 79978 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=79978&action=review
> 
> > Source/WebCore/html/canvas/WebGLRenderingContext.cpp:506
> > +    default:
> > +        return 0;
> 
> Normally we leave defaults out of our switch statements to allow the compiler to check that we covered all the enum values. Then, outside the switch we put something like this:
> 
>     ASSERT_NOT_REACHED();
>     return 0;
> 
> Because it’s not correct for someone to pass in a value that is not one of the enum constants.

I'll fix this in the landing patch.  Thank you.
Comment 5 Zhenyao Mo 2011-01-24 14:42:38 PST
Committed r76549: <http://trac.webkit.org/changeset/76549>