Bug 89913 - [chromium] Add WebLayer API for scrolling
Summary: [chromium] Add WebLayer API for scrolling
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: James Robinson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-25 14:41 PDT by James Robinson
Modified: 2012-06-26 13:50 PDT (History)
9 users (show)

See Also:


Attachments
Patch (24.81 KB, patch)
2012-06-25 14:43 PDT, James Robinson
no flags Details | Formatted Diff | Diff
Patch (24.31 KB, patch)
2012-06-26 11:31 PDT, James Robinson
enne: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Robinson 2012-06-25 14:41:18 PDT
[chromium] Add WebLayer API for scrolling
Comment 1 James Robinson 2012-06-25 14:43:54 PDT
Created attachment 149362 [details]
Patch
Comment 2 James Robinson 2012-06-26 11:31:39 PDT
Created attachment 149572 [details]
Patch
Comment 3 James Robinson 2012-06-26 11:33:11 PDT
How do you feel about this?  I'm anticipating needing somewhere to register a scrolling delegate (or client) to receive scrolling updates from the compositor thread in the near future.
Comment 4 WebKit Review Bot 2012-06-26 11:33:52 PDT
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment 5 Adrienne Walker 2012-06-26 12:04:38 PDT
Comment on attachment 149572 [details]
Patch

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

> Source/Platform/chromium/public/WebLayer.h:141
> +    WEBKIT_EXPORT void setAlwaysReserveTextures(bool);
> +

I'm hoping this can go away with prioritized textures, but I guess we need it for now.

> Source/Platform/chromium/public/WebScrollableLayer.h:47
> +    WEBKIT_EXPORT void setScrollable(bool);

Does this need to be exposed? If we have a separate scrollable layer type, can we just assume that it's scrollable and mark it as such internally?
Comment 6 James Robinson 2012-06-26 12:23:54 PDT
(In reply to comment #5)
> > Source/Platform/chromium/public/WebScrollableLayer.h:47
> > +    WEBKIT_EXPORT void setScrollable(bool);
> 
> Does this need to be exposed? If we have a separate scrollable layer type, can we just assume that it's scrollable and mark it as such internally?

In this patch WebContentLayer derives from WebScrollableLayer, so without a way to mark a layer as scrollable/not scrollable all content layers are assumed scrollable.
Comment 7 Adrienne Walker 2012-06-26 12:25:33 PDT
(In reply to comment #5)
> (From update of attachment 149572 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=149572&action=review
> 
> > Source/Platform/chromium/public/WebScrollableLayer.h:47
> > +    WEBKIT_EXPORT void setScrollable(bool);
> 
> Does this need to be exposed? If we have a separate scrollable layer type, can we just assume that it's scrollable and mark it as such internally?

Oh, right.
Comment 8 Antoine Labour 2012-06-26 12:38:34 PDT
Comment on attachment 149572 [details]
Patch

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

> Source/Platform/chromium/public/WebLayer.h:140
> +    WEBKIT_EXPORT void setAlwaysReserveTextures(bool);

Does this need to be on WebLayer? It wouldn't mean anything for WebExternalTextureLayer for example.
Comment 9 James Robinson 2012-06-26 12:48:45 PDT
It doesn't make much sense in general - it something that we want to remove soon.  It's used to do a crazy thing where the code walks through part of the layer tree and calls this function on every drawable layer to try to make sure root layer scrollbars don't get evicted under memory pressure.  While the call would make more sense on WebContentsLayer (or perhaps WebScrollbarLayer if/when that exists) since it's doing this wacky tree traversal in terms of WebLayer I'd have to do some sort of cast to get to this function.
Comment 10 James Robinson 2012-06-26 12:54:21 PDT
Or to put it another way, the API is somewhat poo but I would prefer to preserve the existing behavior and delete the call when we fix up texture reservation in the compositor to not need this.  I don't want to block wrapping this bit in API on fixing up the compositor's texture reservation stuff.
Comment 11 Antoine Labour 2012-06-26 12:55:30 PDT
Ok, maybe worth a comment noting that it is deprecated then.
Comment 12 James Robinson 2012-06-26 13:11:00 PDT
Marked deprecated in the commit that adds it FTW.
Comment 13 James Robinson 2012-06-26 13:17:25 PDT
Committed r121284: <http://trac.webkit.org/changeset/121284>
Comment 14 Antoine Labour 2012-06-26 13:50:24 PDT
(In reply to comment #12)
> Marked deprecated in the commit that adds it FTW.

If that isn't the Google way, I don't know what is.