-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drawRect_toCanvas() added #7197
Conversation
robolectric/src/test/java/org/robolectric/shadows/ShadowBitmapTest.java
Outdated
Show resolved
Hide resolved
shadows/framework/src/main/java/org/robolectric/shadows/ShadowBitmap.java
Outdated
Show resolved
Hide resolved
shadows/framework/src/main/java/org/robolectric/shadows/ShadowBitmap.java
Outdated
Show resolved
Hide resolved
shadows/framework/src/main/java/org/robolectric/shadows/ShadowBitmap.java
Outdated
Show resolved
Hide resolved
shadows/framework/src/main/java/org/robolectric/shadows/ShadowBitmap.java
Outdated
Show resolved
Hide resolved
@Akshay2131 It's recommend to squash all your commits locally and push it to this PR for further review and CI checking. :) |
This PR also has format problem: https://github.com/robolectric/robolectric/runs/5805197715?check_suite_focus=true. It's recommended to follow https://github.com/robolectric/robolectric/wiki/Robolectric's-code-style to format code locally before pushing. And could you squash your commits to one and push it again? Because they do the one thing. |
@Akshay2131 your new commit message is not recommended. After merged, the |
robolectric/src/test/java/org/robolectric/shadows/ShadowTelephonyManagerTest.java
Outdated
Show resolved
Hide resolved
robolectric/src/test/java/org/robolectric/shadows/ShadowTelephonyManagerTest.java
Outdated
Show resolved
Hide resolved
robolectric/src/test/java/org/robolectric/shadows/ShadowWindowManagerGlobalTest.java
Outdated
Show resolved
Hide resolved
@Akshay2131 Looks like there are some changes not related to this PR, and similar other commits on google branch or opening PR, could you remove them? |
I was having issues to remove extra added files here.. So, i created a new PR that is: |
Thanks @Akshay2131 . I will close this PR. |
Overview
Fixed the issue "Bitmap-backed canvas.drawRect fails with paint" #7188
Proposed Changes
Earlier, the test was failing in Robolectric with the issue :
assertThat(bitmap.getPixel(0, 0)).isEqualTo(Color.WHITE); Expected :-1 Actual :-16777216
It was failing with:
canvas.drawRect(0, 0, 10, 10, paint);
It was failing to draw a rectangle on the canvas.
So, bitmap.getPixel(0, 0) was giving the old pixel value.
I changed the statement from:
canvas.drawRect(0, 0, 10, 10, paint);
to this:
canvas.drawRect(new Rect(0, 0, 10, 10), paint);
Now, it is drawing a rectangle on the canvas,
Now, the test is working properly.
I have added the test to ShadowBitmapTest.java file