Bug 152112

Summary: [TexMap] Clean up TextureMapperAnimation, TextureMapperAnimations
Product: WebKit Reporter: Zan Dobersek <zan>
Component: New BugsAssignee: Zan Dobersek <zan>
Status: RESOLVED FIXED    
Severity: Normal CC: cmarcelo, commit-queue, kondapallykalyan, luiz, mrobinson, noam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing
none
Patch for landing
none
Patch for landing none

Description Zan Dobersek 2015-12-10 01:46:47 PST
[TexMap] Clean up TextureMapperAnimation, TextureMapperAnimations
Comment 1 Zan Dobersek 2015-12-10 02:12:21 PST
Created attachment 267081 [details]
Patch
Comment 2 WebKit Commit Bot 2015-12-10 02:14:03 PST
Attachment 267081 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp:378:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp:384:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 2 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Darin Adler 2015-12-10 11:50:10 PST
Comment on attachment 267081 [details]
Patch

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

Need to fix EFL build.

> Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp:186
> +            operation->blend(nullptr, 1.0 - progress, true)->apply(matrix, boxSize);

Could be just "1 - progress" instead of "1.0 - progress".

> Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp:280
> +void TextureMapperAnimation::pause(double time)

Would like to see this using std::chrono instead of double in the future.

> Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp:323
> +    default:
> +        ASSERT_NOT_REACHED();

Normally we’d put this assertion outside the switch statement so the compiler can warn if we don’t cover all the enum cases. Depends on the type of m_keyframes.property() and whether it has other values we intentionally do not handle.

> Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp:378
> +        [&type](const TextureMapperAnimation& animation) { return animation.isActive() && animation.keyframes().property() == type; });

Why [&type] instead of [type]?
Comment 4 Zan Dobersek 2015-12-15 02:46:03 PST
Comment on attachment 267081 [details]
Patch

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

>> Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp:323
>> +        ASSERT_NOT_REACHED();
> 
> Normally we’d put this assertion outside the switch statement so the compiler can warn if we don’t cover all the enum cases. Depends on the type of m_keyframes.property() and whether it has other values we intentionally do not handle.

This intentionally handles only 3 of 6 possible values for AnimationPropertyID.

>> Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp:378
>> +        [&type](const TextureMapperAnimation& animation) { return animation.isActive() && animation.keyframes().property() == type; });
> 
> Why [&type] instead of [type]?

It makes it clear that the intent is to reference the argument, instead of copying its value.

I don't think there's any difference in the code that's generated though.
Comment 5 Zan Dobersek 2015-12-15 03:33:50 PST
Created attachment 267362 [details]
Patch for landing

Running through the EWS again.
Comment 6 WebKit Commit Bot 2015-12-15 03:35:33 PST
Attachment 267362 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp:378:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp:384:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 2 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Zan Dobersek 2015-12-17 07:12:42 PST
Created attachment 267559 [details]
Patch for landing

Another run through EWS.
Comment 8 WebKit Commit Bot 2015-12-17 07:14:10 PST
Attachment 267559 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp:378:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp:384:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 2 in 8 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 Zan Dobersek 2015-12-29 23:44:53 PST
Created attachment 268002 [details]
Patch for landing
Comment 10 WebKit Commit Bot 2015-12-29 23:51:46 PST
Attachment 268002 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp:378:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp:384:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 2 in 8 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 11 Zan Dobersek 2015-12-30 01:47:43 PST
Committed r194445: <http://trac.webkit.org/changeset/194445>