WebKit Bugzilla
Attachment 341936 Details for
Bug 186289
: AR Badging on transparent thumbnail images makes the glyph look really dark
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186289-20180605094015.patch (text/plain), 6.71 KB, created by
Dean Jackson
on 2018-06-04 16:40:16 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Dean Jackson
Created:
2018-06-04 16:40:16 PDT
Size:
6.71 KB
patch
obsolete
>Subversion Revision: 232271 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index d263198e35b18bbe666190d0752b69a3fe5dcd13..c294e42f9598127f5573027f597e2a07297b1c1c 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,17 @@ >+2018-06-04 Dean Jackson <dino@apple.com> >+ >+ AR Badging on transparent thumbnail images makes the glyph look really dark >+ https://bugs.webkit.org/show_bug.cgi?id=186289 >+ <rdar://problem/40627111> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Clip out the shape for the drop shadow, so that it isn't visible if >+ there is transparent pixel data on top of it. >+ >+ * rendering/RenderThemeIOS.mm: >+ (WebCore::RenderThemeIOS::paintSystemPreviewBadge): >+ > 2018-05-31 Dean Jackson <dino@apple.com> > > Don't paint the System Preview badge if the image isn't fully decoded >diff --git a/Source/WebCore/rendering/RenderThemeIOS.mm b/Source/WebCore/rendering/RenderThemeIOS.mm >index 2efbd0c5dbe01406faae3f686cf5a921a40c8d5c..640a6f3595142a050db55bcb5cc7baeef24f77c7 100644 >--- a/Source/WebCore/rendering/RenderThemeIOS.mm >+++ b/Source/WebCore/rendering/RenderThemeIOS.mm >@@ -1871,8 +1871,16 @@ void RenderThemeIOS::paintSystemPreviewBadge(Image& image, const PaintInfo& pain > CGContextSetFillColorWithColor(ctx, circleColor.get()); > CGContextSetShadowWithColor(ctx, CGSizeZero, 16, shadowColor.get()); > >+ // Clip out the circle to only show the shadow >+ CGContextBeginPath(ctx); >+ CGRect imageRect = static_cast<CGRect>(rect); >+ CGContextAddRect(ctx, imageRect); >+ CGContextAddPath(ctx, circle.get()); >+ CGContextClosePath(ctx); >+ CGContextEOClip(ctx); >+ > // Draw a slightly smaller circle with a shadow, otherwise we'll see a fringe of the solid >- // black circle around the edges of the cliped path below. >+ // black circle around the edges of the clipped path below. > CGContextBeginPath(ctx); > CGRect slightlySmallerAbsoluteBadgeRect = CGRectMake(absoluteBadgeRect.origin.x + 0.5, absoluteBadgeRect.origin.y + 0.5, badgeDimension - 1, badgeDimension - 1); > RetainPtr<CGPathRef> slightlySmallerCircle = adoptCF(CGPathCreateWithRoundedRect(slightlySmallerAbsoluteBadgeRect, slightlySmallerAbsoluteBadgeRect.size.width / 2, slightlySmallerAbsoluteBadgeRect.size.height / 2, nullptr)); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 376893227559f2966c03bd1b3c4b966a97597418..29a8b5a6603b3cc7ef7f41e0d2da596a50eb20ba 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2018-06-04 Dean Jackson <dino@apple.com> >+ >+ AR Badging on transparent thumbnail images makes the glyph look really dark >+ https://bugs.webkit.org/show_bug.cgi?id=186289 >+ <rdar://problem/40627111> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update the test to exercise more background colors. Include the results for the AR badge. >+ >+ * system-preview/badge-expected.html: Added. >+ * system-preview/badge.html: >+ > 2018-05-29 Tadeu Zagallo <tzagallo@apple.com> > > Don't assert on m_actionsStart when setting actions on DFA nodes >diff --git a/LayoutTests/system-preview/badge-expected.html b/LayoutTests/system-preview/badge-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..d454a7126555c01658e03098645d34f8c858ead4 >--- /dev/null >+++ b/LayoutTests/system-preview/badge-expected.html >@@ -0,0 +1,55 @@ >+<!DOCTYPE html> >+<meta name="viewport" content="width=device-width"> >+<style> >+ a { >+ -webkit-clip-path: path("M 82 14 L 84 14 L 84 16 L 82 16 z"); >+ text-decoration: none; >+ } >+ img { >+ width: 100px; >+ height: 100px; >+ } >+</style> >+<script> >+window.addEventListener("load", () => { >+ const canvas = document.createElement("canvas"); >+ canvas.width = 10; >+ canvas.height = 10; >+ const ctx = canvas.getContext("2d"); >+ const images = document.querySelectorAll("img"); >+ images.forEach(image => { >+ ctx.clearRect(0, 0, 10, 10); >+ const color = image.getAttribute("data-color"); >+ ctx.fillStyle = color; >+ ctx.fillRect(0, 0, 10, 10); >+ image.src = canvas.toDataURL(); >+ }); >+}, false); >+</script> >+<a href="/"> >+ <img data-color="rgb(255, 57, 57)"> >+</a> >+<a href="/"> >+ <img data-color="rgb(80, 169, 79)"> >+</a> >+<a href="/"> >+ <img data-color="rgb(102, 102, 255)"> >+</a> >+<a href="/"> >+ <img data-color="rgb(0, 255, 255)"> >+</a> >+<a href="/"> >+ <img data-color="rgb(156, 156, 156)"> >+</a> >+<a href="/"> >+ <img data-color="rgb(255, 176, 105)"> >+</a> >+<a href="/"> >+ <img data-color="white"> >+</a> >+<a href="/"> >+ <img data-color="rgb(118, 118, 118)"> >+</a> >+<a href="/"> >+ <img data-color="rgba(0, 0, 0, 0.0)"> >+</a> >diff --git a/LayoutTests/system-preview/badge.html b/LayoutTests/system-preview/badge.html >index b1c38d2570a55465477e89c0b89e7f08188d1efd..e1620c0784b5b85d656f6ad953128b5569e445e3 100644 >--- a/LayoutTests/system-preview/badge.html >+++ b/LayoutTests/system-preview/badge.html >@@ -1,7 +1,9 @@ > <!DOCTYPE html> >+<meta name="viewport" content="width=device-width"> > <style> > a { >- -webkit-clip-path: path("M 82 14 L 86 14 L 86 18 L 82 18 z"); >+ -webkit-clip-path: path("M 82 14 L 84 14 L 84 16 L 82 16 z"); >+ text-decoration: none; > } > img { > width: 100px; >@@ -10,14 +12,44 @@ > </style> > <script> > window.addEventListener("load", () => { >- if (!window.internals) >- return; >- >- const link = document.querySelector("a"); >- link.rel = internals.systemPreviewRelType(); >+ const canvas = document.createElement("canvas"); >+ canvas.width = 10; >+ canvas.height = 10; >+ const ctx = canvas.getContext("2d"); >+ const images = document.querySelectorAll("img"); >+ images.forEach(image => { >+ ctx.clearRect(0, 0, 10, 10); >+ const color = image.getAttribute("data-color"); >+ ctx.fillStyle = color; >+ ctx.fillRect(0, 0, 10, 10); >+ image.src = canvas.toDataURL(); >+ }); > }, false); > </script> >-<p>This test only works in WKTR or DRT.</p> >-<a href="/"> >- <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAABlBMVEUAAP8AAAB7Yr8+AAAAEElEQVR4nGJgBQAAAP//AwAABwAGzHKrJgAAAABJRU5ErkJggg=="> >+<a href="/" rel="ar"> >+ <img data-color="red"> >+</a> >+<a href="/" rel="ar"> >+ <img data-color="green"> >+</a> >+<a href="/" rel="ar"> >+ <img data-color="blue"> >+</a> >+<a href="/" rel="ar"> >+ <img data-color="cyan"> >+</a> >+<a href="/" rel="ar"> >+ <img data-color="#777777"> >+</a> >+<a href="/" rel="ar"> >+ <img data-color="rgba(255, 128, 0, 0.5)"> >+</a> >+<a href="/" rel="ar"> >+ <img data-color="white"> >+</a> >+<a href="/" rel="ar"> >+ <img data-color="black"> >+</a> >+<a href="/" rel="ar"> >+ <img data-color="rgba(0, 0, 0, 0.0)"> > </a>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
andersca
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186289
: 341936