Bug 83920 - [chromium] There is no Color(float, float, float) constructor, fix an attempt to call it.
Summary: [chromium] There is no Color(float, float, float) constructor, fix an attempt...
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: Nico Weber
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-13 11:13 PDT by Nico Weber
Modified: 2012-04-13 20:07 PDT (History)
1 user (show)

See Also:


Attachments
Patch (2.32 KB, patch)
2012-04-13 11:14 PDT, Nico Weber
no flags Details | Formatted Diff | Diff
Patch for landing (2.32 KB, patch)
2012-04-13 18:06 PDT, Nico Weber
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nico Weber 2012-04-13 11:13:40 PDT
[chromium] There is no Color(float, float, float) constructor, fix an attempt to call it.
Comment 1 Nico Weber 2012-04-13 11:14:40 PDT
Created attachment 137108 [details]
Patch
Comment 2 James Robinson 2012-04-13 11:21:58 PDT
Comment on attachment 137108 [details]
Patch

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

> Source/WebKit/chromium/tests/LayerChromiumTest.cpp:508
> +    EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setBackgroundColor(Color(0.4f, 0.4f, 0.4f, 1.0f)));

Since you're fixing nits here, these should be (0.4, 0.4, 0.4, 1) - no "f" or ".0f" http://www.webkit.org/coding/coding-style.html#float-suffixes
Comment 3 Nico Weber 2012-04-13 12:10:42 PDT
Thanks!

(In reply to comment #2)
> (From update of attachment 137108 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=137108&action=review
> 
> > Source/WebKit/chromium/tests/LayerChromiumTest.cpp:508
> > +    EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setBackgroundColor(Color(0.4f, 0.4f, 0.4f, 1.0f)));
> 
> Since you're fixing nits here, these should be (0.4, 0.4, 0.4, 1) - no "f" or ".0f" http://www.webkit.org/coding/coding-style.html#float-suffixes

That page says "unless required". It's required here:

test.cc:9:3: error: call to constructor of 'Color' is ambiguous
  Color(0.4, 0.4, 0.4, 1.0);
  ^     ~~~~~~~~~~~~~~~~~~
test.cc:4:5: note: candidate constructor
    Color(int r, int g, int b, int a) { }
    ^
test.cc:5:5: note: candidate constructor
    Color(float r, float g, float b, float a) { }
    ^
1 error generated.

hummer:src thakis$ third_party/llvm-build/Release+Asserts/bin/clang -c test.cc
test.cc:9:9: warning: implicit conversion turns literal floating-point number into integer: 'double' to 'int' [-Wliteral-conversion]
  Color(0.4, 0.4, 0.4, 1);
  ~~~~~ ^~~
test.cc:9:14: warning: implicit conversion turns literal floating-point number into integer: 'double' to 'int' [-Wliteral-conversion]
  Color(0.4, 0.4, 0.4, 1);
  ~~~~~      ^~~
test.cc:9:19: warning: implicit conversion turns literal floating-point number into integer: 'double' to 'int' [-Wliteral-conversion]
  Color(0.4, 0.4, 0.4, 1);
  ~~~~~           ^~~
3 warnings generated.
Comment 4 WebKit Review Bot 2012-04-13 17:43:26 PDT
Comment on attachment 137108 [details]
Patch

Rejecting attachment 137108 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:
t/webkit-commit-queue/

Parsed 2 diffs from patch file(s).
patching file Source/WebKit/chromium/ChangeLog
Hunk #1 succeeded at 1 with fuzz 3.
patching file Source/WebKit/chromium/tests/LayerChromiumTest.cpp
Hunk #1 FAILED at 505.
1 out of 1 hunk FAILED -- saving rejects to file Source/WebKit/chromium/tests/LayerChromiumTest.cpp.rej

Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--force', u'--reviewer', u'James Robi..." exit_code: 1 cwd: /mnt/git/webkit-commit-queue/

Full output: http://queues.webkit.org/results/12406079
Comment 5 Nico Weber 2012-04-13 18:06:50 PDT
Created attachment 137190 [details]
Patch for landing
Comment 6 WebKit Review Bot 2012-04-13 20:07:43 PDT
Comment on attachment 137190 [details]
Patch for landing

Clearing flags on attachment: 137190

Committed r114201: <http://trac.webkit.org/changeset/114201>
Comment 7 WebKit Review Bot 2012-04-13 20:07:47 PDT
All reviewed patches have been landed.  Closing bug.