Bug 138759

Summary: [mac] Only images that are actually purgeable should be advertised as such.
Product: WebKit Reporter: Andreas Kling <kling>
Component: Layout and RenderingAssignee: Andreas Kling <kling>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, kling
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Andreas Kling 2014-11-14 15:31:54 PST
Image::decodedDataIsPurgeable() should only return true if the CGImage is backed by purgeable memory.
Comment 1 Andreas Kling 2014-11-14 15:34:34 PST
Created attachment 241633 [details]
Patch
Comment 2 WebKit Commit Bot 2014-11-14 15:35:39 PST
Attachment 241633 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/graphics/cg/BitmapImageCG.cpp:54:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
ERROR: Source/WebCore/platform/graphics/cg/BitmapImageCG.cpp:55:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
Total errors found: 2 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Tim Horton 2014-11-14 15:37:01 PST
Comment on attachment 241633 [details]
Patch

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

> Source/WebCore/platform/graphics/cg/BitmapImageCG.cpp:286
> +        && CGImageGetCachingFlags(m_frames[0].m_frame) & kCGImageCachingTransient;

I'm not sure this is right between accelerated/unaccelerated drawing, but it's probably an improvement over what we're doing now (and probably correct in the more important accelerated case).
Comment 4 Simon Fraser (smfr) 2014-11-14 15:37:26 PST
Comment on attachment 241633 [details]
Patch

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

> Source/WebCore/platform/graphics/cg/BitmapImageCG.cpp:63
> +#if __has_include(<CoreGraphics/CGImagePrivate.h>)
> +#import <CoreGraphics/CGImagePrivate.h>
> +#else
> +enum {
> +    kCGImageCachingTransient = 1,
> +    kCGImageCachingTemporary = 3
> +};
> +typedef uint32_t CGImageCachingFlags;
> +extern "C" CGImageCachingFlags CGImageGetCachingFlags(CGImageRef image);
> +#endif

This should go into the CoreGraphicsSPI.h stuff that dbates is working on.
Comment 5 Andreas Kling 2014-11-14 16:04:27 PST
Created attachment 241637 [details]
Patch
Comment 6 Andreas Kling 2014-11-14 16:05:23 PST
Comment on attachment 241637 [details]
Patch

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

> Source/WebCore/platform/spi/cg/CoreGraphicsSPI.h:136
> +EXTERN_C CGImageCachingFlags CGImageGetCachingFlags(CGImageRef image);

Boo, we shouldn't have an argument name here.
Comment 7 WebKit Commit Bot 2014-11-14 16:08:05 PST
Attachment 241637 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/spi/cg/CoreGraphicsSPI.h:136:  The parameter name "image" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 1 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 Andreas Kling 2014-11-14 16:35:58 PST
Committed r176149: <http://trac.webkit.org/changeset/176149>