WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
70646
Ensure periodic flushing of accelerated canvas drawing context
https://bugs.webkit.org/show_bug.cgi?id=70646
Summary
Ensure periodic flushing of accelerated canvas drawing context
Matthew Delaney
Reported
2011-10-21 13:56:45 PDT
If flushes don't happen regularly enough on a canvas drawing context that is accelerated, subsequent call performance can get pretty bad. "Regularly enough" is geared toward a 30-60hz paint cycle. So, this patch ensures that we're getting flushes of a rate in that range if they're not already happening (e.g. from HTMLCanvasElement::paint calls) in that range.
Attachments
Patch
(6.13 KB, patch)
2011-10-21 14:15 PDT
,
Matthew Delaney
simon.fraser
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Matthew Delaney
Comment 1
2011-10-21 14:15:03 PDT
Created
attachment 112020
[details]
Patch
Simon Fraser (smfr)
Comment 2
2011-10-21 14:23:01 PDT
Comment on
attachment 112020
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=112020&action=review
> Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp:168 > + m_context = adoptPtr(new GraphicsContext(cgContext.get()));
Should you set m_data.m_lastFlushTime on context creation?
Darin Adler
Comment 3
2011-10-21 14:25:47 PDT
Comment on
attachment 112020
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=112020&action=review
> Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp:184 > GraphicsContext* ImageBuffer::context() const
Is this really the best bottleneck for the timing logic? Can we instead put this at the ends of the drawing operations that accumulate state in the context? Or are those too many of those. This hook seems particularly awkward since it’s just a getter.
Darin Adler
Comment 4
2011-10-21 14:27:51 PDT
Comment on
attachment 112020
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=112020&action=review
> Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp:188 > + double elapsedTime = currentTimeMS() - m_data.m_lastFlushTime;
What is the performance cost of doing this every time we call context()? Seems like it might be high.
Matthew Delaney
Comment 5
2011-10-21 15:08:04 PDT
(In reply to
comment #2
)
> Should you set m_data.m_lastFlushTime on context creation?
Yea, that's better. (In reply to
comment #3
)
> > Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp:184 > > GraphicsContext* ImageBuffer::context() const > > Is this really the best bottleneck for the timing logic? Can we instead put this at the ends of the drawing operations that accumulate state in the context? Or are those too many of those. This hook seems particularly awkward since it’s just a getter.
That's what I had originally, but there are about 5-10 calls and it would require having all this logic in GraphicsContext which becomes a bit more cluttered. (In reply to
comment #4
)
> (From update of
attachment 112020
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=112020&action=review
> > > Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp:188 > > + double elapsedTime = currentTimeMS() - m_data.m_lastFlushTime; > > What is the performance cost of doing this every time we call context()? Seems like it might be high.
Running it locally, I didn't notice any difference in perf on one page I had open. I'll try it out on a handful of other pages now.
Matthew Delaney
Comment 6
2011-10-21 16:42:55 PDT
Couldn't find any performance deficit, so I think we're good. Committing now.
Matthew Delaney
Comment 7
2011-10-21 17:00:57 PDT
Committed
r98171
: <
http://trac.webkit.org/changeset/98171
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug