WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 51736
Implement RemoteFontStream's skip behavior (in FontCustomPlatformData.cpp)
https://bugs.webkit.org/show_bug.cgi?id=51736
Summary
Implement RemoteFontStream's skip behavior (in FontCustomPlatformData.cpp)
Xianzhu Wang
Reported
2010-12-30 01:28:32 PST
The implementation of RemoteFontStream (in WebCore/platform/graphics/skia/FontCustomPlatformData.cpp) is not complete, missing 'skip' feature. Though Chromium port doesn't use the skip feature (it reads the whole stream data at once), other ports using Skia might encounter problems if the stream is passed to Skia. The SkStream::skip() and SkStream::read(NULL, skip) functionalities are used frequently in Skia code. This will cause failures when loading a font from a stream.
Attachments
The patch
(1.83 KB, patch)
2010-12-30 01:35 PST
,
Xianzhu Wang
no flags
Details
Formatted Diff
Diff
Updated patch (fixed style break)
(1.83 KB, patch)
2010-12-30 01:42 PST
,
Xianzhu Wang
levin
: review-
Details
Formatted Diff
Diff
updated patch
(2.07 KB, patch)
2011-01-05 18:24 PST
,
Xianzhu Wang
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Xianzhu Wang
Comment 1
2010-12-30 01:35:24 PST
Created
attachment 77665
[details]
The patch
WebKit Review Bot
Comment 2
2010-12-30 01:36:28 PST
Attachment 77665
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'WebCore/ChangeLog', u'WebCore/platform/graphics/skia/FontCustomPlatformData.cpp']" exit_code: 1 WebCore/platform/graphics/skia/FontCustomPlatformData.cpp:152: Use 0 instead of NULL. [readability/null] [4] Total errors found: 1 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Xianzhu Wang
Comment 3
2010-12-30 01:42:00 PST
Created
attachment 77666
[details]
Updated patch (fixed style break)
Eric Seidel (no email)
Comment 4
2010-12-31 09:07:03 PST
Comment on
attachment 77666
[details]
Updated patch (fixed style break) View in context:
https://bugs.webkit.org/attachment.cgi?id=77666&action=review
> WebCore/platform/graphics/skia/FontCustomPlatformData.cpp:153 > if (!m_buffer->data() || !m_buffer->size())
I'm confused. Your'e removing a null check of buffer, yet using buffer unconditionally?
Xianzhu Wang
Comment 5
2011-01-02 19:31:17 PST
(In reply to
comment #4
)
> (From update of
attachment 77666
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=77666&action=review
> > > WebCore/platform/graphics/skia/FontCustomPlatformData.cpp:153 > > if (!m_buffer->data() || !m_buffer->size()) > > I'm confused. Your'e removing a null check of buffer, yet using buffer unconditionally?
The condition is now at line 157 of the new file. The 'read' and 'skip' features only differ at line 158.
Xianzhu Wang
Comment 6
2011-01-04 18:03:28 PST
Hi, reviewers?
David Levin
Comment 7
2011-01-05 16:31:22 PST
Comment on
attachment 77666
[details]
Updated patch (fixed style break) View in context:
https://bugs.webkit.org/attachment.cgi?id=77666&action=review
> WebCore/ChangeLog:8 > + No new tests.
Should say why. We can see there are no new tests. Is it not testable for some reason?
>>> WebCore/platform/graphics/skia/FontCustomPlatformData.cpp:153 >>> if (!m_buffer->data() || !m_buffer->size()) >> >> I'm confused. Your'e removing a null check of buffer, yet using buffer unconditionally? > > The condition is now at line 157 of the new file. The 'read' and 'skip' features only differ at line 158.
The change removes the check on buffer (which is the skip bytes feature being implemented). The code is only using m_buffer (except on line 158 where it does the check for buffer).
> WebCore/platform/graphics/skia/FontCustomPlatformData.cpp:156 > + size_t toReadOrSkip = (left > size) ? size : left;
Seems like this should use std::min. Also the name "toReadOrSkip" is awkward. How about bytesToRead or bytesToConsume? (Even though the bytes may not be written to buffer, they are still "read" or else this function ("read") should be named something different.)
Xianzhu Wang
Comment 8
2011-01-05 18:23:18 PST
(In reply to
comment #7
) Thanks for review!
> (From update of
attachment 77666
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=77666&action=review
> > > WebCore/ChangeLog:8 > > + No new tests. > > Should say why. We can see there are no new tests. > > Is it not testable for some reason?
> Added reason of no test in ChangeLog.
> >>> WebCore/platform/graphics/skia/FontCustomPlatformData.cpp:153 > >>> if (!m_buffer->data() || !m_buffer->size()) > >> > >> I'm confused. Your'e removing a null check of buffer, yet using buffer unconditionally? > > > > The condition is now at line 157 of the new file. The 'read' and 'skip' features only differ at line 158. > > The change removes the check on buffer (which is the skip bytes feature being implemented). The code is only using m_buffer (except on line 158 where it does the check for buffer). > > > WebCore/platform/graphics/skia/FontCustomPlatformData.cpp:156 > > + size_t toReadOrSkip = (left > size) ? size : left; > > Seems like this should use std::min.
> Done.
> Also the name "toReadOrSkip" is awkward. How about bytesToRead or bytesToConsume? (Even though the bytes may not be written to buffer, they are still "read" or else this function ("read") should be named something different.)
Changed to bytesToConsume. I agree this is a problem, but the 'read or skip' semantic is defined by SkStream::read() in Skia and we can only follow it.
Xianzhu Wang
Comment 9
2011-01-05 18:24:37 PST
Created
attachment 78084
[details]
updated patch
David Levin
Comment 10
2011-01-05 18:28:14 PST
Comment on
attachment 78084
[details]
updated patch Sounds like "No new tests because existing test(s) already exercise this functionality (for ports other than Chromium using Skia)." (would have been sufficient).
WebKit Commit Bot
Comment 11
2011-01-05 22:15:32 PST
Comment on
attachment 78084
[details]
updated patch Clearing flags on attachment: 78084 Committed
r75140
: <
http://trac.webkit.org/changeset/75140
>
WebKit Commit Bot
Comment 12
2011-01-05 22:15:38 PST
All reviewed patches have been landed. Closing bug.
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