WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Proposed fix (added the modified changelog).
bug35453.txt (text/plain), 21.76 KB, created by
David Levin
on 2010-03-02 16:26:27 PST
(
hide
)
Description:
Proposed fix (added the modified changelog).
Filename:
MIME Type:
Creator:
David Levin
Created:
2010-03-02 16:26:27 PST
Size:
21.76 KB
patch
obsolete
>diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog >index 756d316..19f96b5 100644 >--- a/WebCore/ChangeLog >+++ b/WebCore/ChangeLog >@@ -1,3 +1,56 @@ >+2010-03-02 David Levin <levin@chromium.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Need to move items that CanvasRenderingContext2D depends on into CanvasSurface. >+ https://bugs.webkit.org/show_bug.cgi?id=35453 >+ >+ Prepartory changes to allow for an OffscreenCanvas which may be used in a worker >+ or outside of the DOM. >+ >+ No change in functionality, so new tests. >+ >+ * dom/CanvasSurface.cpp: Moved functionality that CanvasRenderingContext2D depends on >+ into this class (and removed dependencies on document/html element). >+ (WebCore::CanvasSurface::CanvasSurface): >+ (WebCore::CanvasSurface::~CanvasSurface): Put the desctructor in the cpp file >+ to avoid needing access to ~ImageBuffer in the header file. >+ (WebCore::CanvasSurface::setSurfaceSize): Does basic items needed >+ when the size changes. It is protected to force outside callers to go >+ through HTMLCanvasElement::setSize. >+ (WebCore::CanvasSurface::toDataURL): Just moved from HTMLCanvasElement and >+ made a note about a method to fix for worker usage. >+ (WebCore::CanvasSurface::willDraw): Made this virtual to allow an overide >+ which uses the renderbox and tracks a dirtyRect. >+ (WebCore::CanvasSurface::convertLogicalToDevice): Moved and changed to >+ rely on a member variable for page scale (to avoid using the document). >+ (WebCore::CanvasSurface::createImageBuffer): >+ (WebCore::CanvasSurface::drawingContext): Simple move from HTMLCanvasElement. >+ (WebCore::CanvasSurface::buffer): Ditto. >+ (WebCore::CanvasSurface::baseTransform): Ditto. >+ * dom/CanvasSurface.h: >+ (WebCore::CanvasSurface::width): Simple move from HTMLCanvasElement. >+ (WebCore::CanvasSurface::height): Ditto. >+ (WebCore::CanvasSurface::size): Ditto. >+ (WebCore::CanvasSurface::setOriginTainted): Ditto. >+ (WebCore::CanvasSurface::originClean): Ditto. >+ (WebCore::CanvasSurface::hasCreatedImageBuffer): Ditto (with small name change). >+ * html/HTMLCanvasElement.cpp: >+ (WebCore::HTMLCanvasElement::HTMLCanvasElement): Pass in the scale factor to CanvasSurface >+ so it doesn't need the document. >+ (WebCore::HTMLCanvasElement::willDraw): Moved the relevant portion to CanvasSurface. >+ (WebCore::HTMLCanvasElement::reset): Small changes due to refactoring. >+ (WebCore::HTMLCanvasElement::paint): Ditto. >+ * html/HTMLCanvasElement.h: >+ (WebCore::HTMLCanvasElement::setSize): Ditto. >+ * platform/MIMETypeRegistry.cpp: >+ (WebCore::MIMETypeRegistry::isSupportedImageMIMETypeForEncoding): Added assert >+ to verify that this is only called on the main thread. >+ * platform/graphics/Image.cpp: >+ (WebCore::Image::nullImage): Ditto. >+ * platform/graphics/cg/ImageBufferCG.cpp: >+ (WebCore::utiFromMIMEType): Ditto. >+ > 2010-02-26 Adam Barth <abarth@webkit.org> > > Reviewed by Darin Adler. >diff --git a/WebCore/dom/CanvasSurface.cpp b/WebCore/dom/CanvasSurface.cpp >index 69c7951..aa0a0be 100644 >--- a/WebCore/dom/CanvasSurface.cpp >+++ b/WebCore/dom/CanvasSurface.cpp >@@ -26,6 +26,132 @@ > #include "config.h" > #include "CanvasSurface.h" > >+#include "AffineTransform.h" >+#include "ExceptionCode.h" >+#include "FloatRect.h" >+#include "GraphicsContext.h" >+#include "ImageBuffer.h" >+#include "MIMETypeRegistry.h" >+ > namespace WebCore { > >+// These values come from the WhatWG spec. >+const int CanvasSurface::DefaultWidth = 300; >+const int CanvasSurface::DefaultHeight = 150; >+ >+// Firefox limits width/height to 32767 pixels, but slows down dramatically before it >+// reaches that limit. We limit by area instead, giving us larger maximum dimensions, >+// in exchange for a smaller maximum canvas size. >+const float CanvasSurface::MaxCanvasArea = 32768 * 8192; // Maximum canvas area in CSS pixels >+ >+CanvasSurface::CanvasSurface(float pageScaleFactor) >+ : m_size(DefaultWidth, DefaultHeight) >+ , m_pageScaleFactor(pageScaleFactor) >+ , m_originClean(true) >+ , m_hasCreatedImageBuffer(false) >+{ >+} >+ >+CanvasSurface::~CanvasSurface() >+{ >+} >+ >+void CanvasSurface::setSurfaceSize(const IntSize& size) >+{ >+ m_size = size; >+ m_hasCreatedImageBuffer = false; >+ m_imageBuffer.clear(); >+} >+ >+String CanvasSurface::toDataURL(const String& mimeType, ExceptionCode& ec) >+{ >+ if (!m_originClean) { >+ ec = SECURITY_ERR; >+ return String(); >+ } >+ >+ if (m_size.isEmpty() || !buffer()) >+ return String("data:,"); >+ >+ // FIXME: Make isSupportedImageMIMETypeForEncoding threadsafe (to allow this method to be used on a worker thread). >+ if (mimeType.isNull() || !MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)) >+ return buffer()->toDataURL("image/png"); >+ >+ return buffer()->toDataURL(mimeType); >+} >+ >+void CanvasSurface::willDraw(const FloatRect&) >+{ >+ if (m_imageBuffer) >+ m_imageBuffer->clearImage(); >+} >+ >+IntRect CanvasSurface::convertLogicalToDevice(const FloatRect& logicalRect) const >+{ >+ return IntRect(convertLogicalToDevice(logicalRect.location()), convertLogicalToDevice(logicalRect.size())); >+} >+ >+IntSize CanvasSurface::convertLogicalToDevice(const FloatSize& logicalSize) const >+{ >+ float wf = ceilf(logicalSize.width() * m_pageScaleFactor); >+ float hf = ceilf(logicalSize.height() * m_pageScaleFactor); >+ >+ if (!(wf >= 1 && hf >= 1 && wf * hf <= MaxCanvasArea)) >+ return IntSize(); >+ >+ return IntSize(static_cast<unsigned>(wf), static_cast<unsigned>(hf)); >+} >+ >+IntPoint CanvasSurface::convertLogicalToDevice(const FloatPoint& logicalPos) const >+{ >+ float xf = logicalPos.x() * m_pageScaleFactor; >+ float yf = logicalPos.y() * m_pageScaleFactor; >+ >+ return IntPoint(static_cast<unsigned>(xf), static_cast<unsigned>(yf)); >+} >+ >+void CanvasSurface::createImageBuffer() const >+{ >+ ASSERT(!m_imageBuffer); >+ >+ m_hasCreatedImageBuffer = true; >+ >+ FloatSize unscaledSize(width(), height()); >+ IntSize size = convertLogicalToDevice(unscaledSize); >+ if (!size.width() || !size.height()) >+ return; >+ >+ m_imageBuffer = ImageBuffer::create(size); >+ // The convertLogicalToDevice MaxCanvasArea check should prevent common cases >+ // where ImageBuffer::create() returns 0, however we could still be low on memory. >+ if (!m_imageBuffer) >+ return; >+ m_imageBuffer->context()->scale(FloatSize(size.width() / unscaledSize.width(), size.height() / unscaledSize.height())); >+ m_imageBuffer->context()->setShadowsIgnoreTransforms(true); >+} >+ >+GraphicsContext* CanvasSurface::drawingContext() const >+{ >+ return buffer() ? m_imageBuffer->context() : 0; >+} >+ >+ImageBuffer* CanvasSurface::buffer() const >+{ >+ if (!m_hasCreatedImageBuffer) >+ createImageBuffer(); >+ return m_imageBuffer.get(); >+} >+ >+AffineTransform CanvasSurface::baseTransform() const >+{ >+ ASSERT(m_hasCreatedImageBuffer); >+ FloatSize unscaledSize(width(), height()); >+ IntSize size = convertLogicalToDevice(unscaledSize); >+ AffineTransform transform; >+ if (size.width() && size.height()) >+ transform.scaleNonUniform(size.width() / unscaledSize.width(), size.height() / unscaledSize.height()); >+ transform.multiply(m_imageBuffer->baseTransform()); >+ return transform; >+} >+ > } // namespace WebCore >diff --git a/WebCore/dom/CanvasSurface.h b/WebCore/dom/CanvasSurface.h >index 118db8f..22f79d1 100644 >--- a/WebCore/dom/CanvasSurface.h >+++ b/WebCore/dom/CanvasSurface.h >@@ -26,14 +26,72 @@ > #ifndef CanvasSurface_h > #define CanvasSurface_h > >+#include "AffineTransform.h" >+#include "IntSize.h" >+ >+#include <wtf/OwnPtr.h> > #include <wtf/Noncopyable.h> > > namespace WebCore { > >+class AffineTransform; >+class FloatPoint; >+class FloatRect; >+class FloatSize; >+class GraphicsContext; >+class ImageBuffer; >+class IntPoint; >+class String; >+ >+typedef int ExceptionCode; >+ > class CanvasSurface : public Noncopyable { > public: >+ CanvasSurface(float pageScaleFactor); >+ virtual ~CanvasSurface(); >+ >+ int width() const { return m_size.width(); } >+ int height() const { return m_size.height(); } >+ >+ String toDataURL(const String& mimeType, ExceptionCode&); >+ >+ const IntSize& size() const { return m_size; } >+ >+ virtual void willDraw(const FloatRect&); >+ >+ GraphicsContext* drawingContext() const; >+ >+ ImageBuffer* buffer() const; >+ >+ IntRect convertLogicalToDevice(const FloatRect&) const; >+ IntSize convertLogicalToDevice(const FloatSize&) const; >+ IntPoint convertLogicalToDevice(const FloatPoint&) const; >+ >+ void setOriginTainted() { m_originClean = false; } >+ bool originClean() const { return m_originClean; } >+ >+ AffineTransform baseTransform() const; >+ >+protected: >+ void setSurfaceSize(const IntSize&); >+ bool hasCreatedImageBuffer() const { return m_hasCreatedImageBuffer; } >+ >+ static const int DefaultWidth; >+ static const int DefaultHeight; > > private: >+ void createImageBuffer() const; >+ >+ static const float MaxCanvasArea; >+ >+ IntSize m_size; >+ >+ float m_pageScaleFactor; >+ bool m_originClean; >+ >+ // m_createdImageBuffer means we tried to malloc the buffer. We didn't necessarily get it. >+ mutable bool m_hasCreatedImageBuffer; >+ mutable OwnPtr<ImageBuffer> m_imageBuffer; > }; > > } // namespace WebCore >diff --git a/WebCore/html/HTMLCanvasElement.cpp b/WebCore/html/HTMLCanvasElement.cpp >index adffe4a..c886f53 100644 >--- a/WebCore/html/HTMLCanvasElement.cpp >+++ b/WebCore/html/HTMLCanvasElement.cpp >@@ -28,22 +28,20 @@ > #include "HTMLCanvasElement.h" > > #include "CanvasContextAttributes.h" >-#include "CanvasGradient.h" >-#include "CanvasPattern.h" > #include "CanvasRenderingContext2D.h" > #if ENABLE(3D_CANVAS) > #include "WebGLContextAttributes.h" > #include "WebGLRenderingContext.h" > #endif >+#include "CanvasGradient.h" >+#include "CanvasPattern.h" > #include "CanvasStyle.h" > #include "Chrome.h" > #include "Document.h" >-#include "ExceptionCode.h" > #include "Frame.h" > #include "GraphicsContext.h" > #include "HTMLNames.h" > #include "ImageBuffer.h" >-#include "MIMETypeRegistry.h" > #include "MappedAttribute.h" > #include "Page.h" > #include "RenderHTMLCanvas.h" >@@ -55,22 +53,11 @@ namespace WebCore { > > using namespace HTMLNames; > >-// These values come from the WhatWG spec. >-static const int defaultWidth = 300; >-static const int defaultHeight = 150; >- >-// Firefox limits width/height to 32767 pixels, but slows down dramatically before it >-// reaches that limit. We limit by area instead, giving us larger maximum dimensions, >-// in exchange for a smaller maximum canvas size. >-const float HTMLCanvasElement::MaxCanvasArea = 32768 * 8192; // Maximum canvas area in CSS pixels >- > HTMLCanvasElement::HTMLCanvasElement(const QualifiedName& tagName, Document* doc) > : HTMLElement(tagName, doc) >- , m_size(defaultWidth, defaultHeight) >+ , CanvasSurface(doc->frame() ? doc->frame()->page()->chrome()->scaleFactor() : 1) > , m_observer(0) >- , m_originClean(true) > , m_ignoreReset(false) >- , m_createdImageBuffer(false) > { > ASSERT(hasTagName(canvasTag)); > } >@@ -133,22 +120,6 @@ void HTMLCanvasElement::setWidth(int value) > setAttribute(widthAttr, String::number(value)); > } > >-String HTMLCanvasElement::toDataURL(const String& mimeType, ExceptionCode& ec) >-{ >- if (!m_originClean) { >- ec = SECURITY_ERR; >- return String(); >- } >- >- if (m_size.isEmpty() || !buffer()) >- return String("data:,"); >- >- if (mimeType.isNull() || !MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)) >- return buffer()->toDataURL("image/png"); >- >- return buffer()->toDataURL(mimeType); >-} >- > CanvasRenderingContext* HTMLCanvasElement::getContext(const String& type, CanvasContextAttributes* attrs) > { > // A Canvas can either be "2D" or "webgl" but never both. If you request a 2D canvas and the existing >@@ -193,12 +164,11 @@ CanvasRenderingContext* HTMLCanvasElement::getContext(const String& type, Canvas > > void HTMLCanvasElement::willDraw(const FloatRect& rect) > { >- if (m_imageBuffer) >- m_imageBuffer->clearImage(); >- >+ CanvasSurface::willDraw(rect); >+ > if (RenderBox* ro = renderBox()) { > FloatRect destRect = ro->contentBoxRect(); >- FloatRect r = mapRect(rect, FloatRect(0, 0, m_size.width(), m_size.height()), destRect); >+ FloatRect r = mapRect(rect, FloatRect(0, 0, size().width(), size().height()), destRect); > r.intersect(destRect); > if (m_dirtyRect.contains(r)) > return; >@@ -219,28 +189,26 @@ void HTMLCanvasElement::reset() > bool ok; > int w = getAttribute(widthAttr).toInt(&ok); > if (!ok) >- w = defaultWidth; >+ w = DefaultWidth; > int h = getAttribute(heightAttr).toInt(&ok); > if (!ok) >- h = defaultHeight; >+ h = DefaultHeight; > >- IntSize oldSize = m_size; >- m_size = IntSize(w, h); >+ IntSize oldSize = size(); >+ setSurfaceSize(IntSize(w, h)); > > #if ENABLE(3D_CANVAS) > if (m_context && m_context->is3d()) > static_cast<WebGLRenderingContext*>(m_context.get())->reshape(width(), height()); > #endif > >- bool hadImageBuffer = m_createdImageBuffer; >- m_createdImageBuffer = false; >- m_imageBuffer.clear(); >+ bool hadImageBuffer = hasCreatedImageBuffer(); > if (m_context && m_context->is2d()) > static_cast<CanvasRenderingContext2D*>(m_context.get())->reset(); > > if (RenderObject* renderer = this->renderer()) { > if (m_rendererIsCanvas) { >- if (oldSize != m_size) >+ if (oldSize != size()) > toRenderHTMLCanvas(renderer)->canvasSizeChanged(); > if (hadImageBuffer) > renderer->repaint(); >@@ -267,10 +235,13 @@ void HTMLCanvasElement::paint(GraphicsContext* context, const IntRect& r) > } > #endif > >- if (m_imageBuffer) { >- Image* image = m_imageBuffer->image(); >- if (image) >- context->drawImage(image, DeviceColorSpace, r); >+ if (hasCreatedImageBuffer()) { >+ ImageBuffer* imageBuffer = buffer(); >+ if (imageBuffer) { >+ Image* image = imageBuffer->image(); >+ if (image) >+ context->drawImage(image, DeviceColorSpace, r); >+ } > } > > #if ENABLE(3D_CANVAS) >@@ -279,76 +250,6 @@ void HTMLCanvasElement::paint(GraphicsContext* context, const IntRect& r) > #endif > } > >-IntRect HTMLCanvasElement::convertLogicalToDevice(const FloatRect& logicalRect) const >-{ >- return IntRect(convertLogicalToDevice(logicalRect.location()), convertLogicalToDevice(logicalRect.size())); >-} >- >-IntSize HTMLCanvasElement::convertLogicalToDevice(const FloatSize& logicalSize) const >-{ >- float pageScaleFactor = document()->frame() ? document()->frame()->page()->chrome()->scaleFactor() : 1.0f; >- float wf = ceilf(logicalSize.width() * pageScaleFactor); >- float hf = ceilf(logicalSize.height() * pageScaleFactor); >- >- if (!(wf >= 1 && hf >= 1 && wf * hf <= MaxCanvasArea)) >- return IntSize(); >- >- return IntSize(static_cast<unsigned>(wf), static_cast<unsigned>(hf)); >-} >- >-IntPoint HTMLCanvasElement::convertLogicalToDevice(const FloatPoint& logicalPos) const >-{ >- float pageScaleFactor = document()->frame() ? document()->frame()->page()->chrome()->scaleFactor() : 1.0f; >- float xf = logicalPos.x() * pageScaleFactor; >- float yf = logicalPos.y() * pageScaleFactor; >- >- return IntPoint(static_cast<unsigned>(xf), static_cast<unsigned>(yf)); >-} >- >-void HTMLCanvasElement::createImageBuffer() const >-{ >- ASSERT(!m_imageBuffer); >- >- m_createdImageBuffer = true; >- >- FloatSize unscaledSize(width(), height()); >- IntSize size = convertLogicalToDevice(unscaledSize); >- if (!size.width() || !size.height()) >- return; >- >- m_imageBuffer = ImageBuffer::create(size); >- // The convertLogicalToDevice MaxCanvasArea check should prevent common cases >- // where ImageBuffer::create() returns NULL, however we could still be low on memory. >- if (!m_imageBuffer) >- return; >- m_imageBuffer->context()->scale(FloatSize(size.width() / unscaledSize.width(), size.height() / unscaledSize.height())); >- m_imageBuffer->context()->setShadowsIgnoreTransforms(true); >-} >- >-GraphicsContext* HTMLCanvasElement::drawingContext() const >-{ >- return buffer() ? m_imageBuffer->context() : 0; >-} >- >-ImageBuffer* HTMLCanvasElement::buffer() const >-{ >- if (!m_createdImageBuffer) >- createImageBuffer(); >- return m_imageBuffer.get(); >-} >- >-AffineTransform HTMLCanvasElement::baseTransform() const >-{ >- ASSERT(m_createdImageBuffer); >- FloatSize unscaledSize(width(), height()); >- IntSize size = convertLogicalToDevice(unscaledSize); >- AffineTransform transform; >- if (size.width() && size.height()) >- transform.scaleNonUniform(size.width() / unscaledSize.width(), size.height() / unscaledSize.height()); >- transform.multiply(m_imageBuffer->baseTransform()); >- return transform; >-} >- > #if ENABLE(3D_CANVAS) > bool HTMLCanvasElement::is3D() const > { >diff --git a/WebCore/html/HTMLCanvasElement.h b/WebCore/html/HTMLCanvasElement.h >index a29c1b8..79e6f15 100644 >--- a/WebCore/html/HTMLCanvasElement.h >+++ b/WebCore/html/HTMLCanvasElement.h >@@ -27,7 +27,6 @@ > #ifndef HTMLCanvasElement_h > #define HTMLCanvasElement_h > >-#include "AffineTransform.h" > #include "CanvasSurface.h" > #include "FloatRect.h" > #include "HTMLElement.h" >@@ -40,13 +39,8 @@ namespace WebCore { > > class CanvasContextAttributes; > class CanvasRenderingContext; >-class FloatPoint; >-class FloatRect; >-class FloatSize; > class GraphicsContext; > class HTMLCanvasElement; >-class ImageBuffer; >-class IntPoint; > class IntSize; > > class CanvasObserver { >@@ -63,46 +57,28 @@ public: > HTMLCanvasElement(const QualifiedName&, Document*); > virtual ~HTMLCanvasElement(); > >- int width() const { return m_size.width(); } >- int height() const { return m_size.height(); } > void setWidth(int); > void setHeight(int); > >- String toDataURL(const String& mimeType, ExceptionCode&); >- > CanvasRenderingContext* getContext(const String&, CanvasContextAttributes* attributes = 0); > >- const IntSize& size() const { return m_size; } >- void setSize(const IntSize& size) >+ void setSize(const IntSize& newSize) > { >- if (size == m_size) >+ if (newSize == size()) > return; > m_ignoreReset = true; >- setWidth(size.width()); >- setHeight(size.height()); >+ setWidth(newSize.width()); >+ setHeight(newSize.height()); > m_ignoreReset = false; > reset(); > } > >- void willDraw(const FloatRect&); >+ virtual void willDraw(const FloatRect&); > > void paint(GraphicsContext*, const IntRect&); > >- GraphicsContext* drawingContext() const; >- >- ImageBuffer* buffer() const; >- >- IntRect convertLogicalToDevice(const FloatRect&) const; >- IntSize convertLogicalToDevice(const FloatSize&) const; >- IntPoint convertLogicalToDevice(const FloatPoint&) const; >- >- void setOriginTainted() { m_originClean = false; } >- bool originClean() const { return m_originClean; } >- > void setObserver(CanvasObserver* observer) { m_observer = observer; } > >- AffineTransform baseTransform() const; >- > CanvasRenderingContext* renderingContext() const { return m_context.get(); } > > #if ENABLE(3D_CANVAS) >@@ -118,24 +94,15 @@ private: > virtual void parseMappedAttribute(MappedAttribute*); > virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); > >- void createImageBuffer() const; > void reset(); > >- static const float MaxCanvasArea; >- > bool m_rendererIsCanvas; > > OwnPtr<CanvasRenderingContext> m_context; >- IntSize m_size; > CanvasObserver* m_observer; > >- bool m_originClean; > bool m_ignoreReset; > FloatRect m_dirtyRect; >- >- // m_createdImageBuffer means we tried to malloc the buffer. We didn't necessarily get it. >- mutable bool m_createdImageBuffer; >- mutable OwnPtr<ImageBuffer> m_imageBuffer; > }; > > } //namespace >diff --git a/WebCore/platform/MIMETypeRegistry.cpp b/WebCore/platform/MIMETypeRegistry.cpp >index f5b003b..d961f86 100644 >--- a/WebCore/platform/MIMETypeRegistry.cpp >+++ b/WebCore/platform/MIMETypeRegistry.cpp >@@ -369,6 +369,8 @@ bool MIMETypeRegistry::isSupportedImageResourceMIMEType(const String& mimeType) > > bool MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(const String& mimeType) > { >+ ASSERT(isMainThread()); >+ > if (mimeType.isEmpty()) > return false; > if (!supportedImageMIMETypesForEncoding) >diff --git a/WebCore/platform/graphics/Image.cpp b/WebCore/platform/graphics/Image.cpp >index 8263faa..ac61658 100644 >--- a/WebCore/platform/graphics/Image.cpp >+++ b/WebCore/platform/graphics/Image.cpp >@@ -53,6 +53,7 @@ Image::~Image() > > Image* Image::nullImage() > { >+ ASSERT(isMainThread()); > DEFINE_STATIC_LOCAL(RefPtr<Image>, nullImage, (BitmapImage::create()));; > return nullImage.get(); > } >diff --git a/WebCore/platform/graphics/cg/ImageBufferCG.cpp b/WebCore/platform/graphics/cg/ImageBufferCG.cpp >index 0dc7a53..ed10bdf 100644 >--- a/WebCore/platform/graphics/cg/ImageBufferCG.cpp >+++ b/WebCore/platform/graphics/cg/ImageBufferCG.cpp >@@ -38,6 +38,7 @@ > #include <wtf/Assertions.h> > #include <wtf/OwnArrayPtr.h> > #include <wtf/RetainPtr.h> >+#include <wtf/Threading.h> > #include <math.h> > > using namespace std; >@@ -254,6 +255,8 @@ static RetainPtr<CFStringRef> utiFromMIMEType(const String& mimeType) > RetainPtr<CFStringRef> mimeTypeCFString(AdoptCF, mimeType.createCFString()); > return RetainPtr<CFStringRef>(AdoptCF, UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, mimeTypeCFString.get(), 0)); > #else >+ ASSERT(isMainThread()); // It is unclear if CFSTR is threadsafe. >+ > // FIXME: Add Windows support for all the supported UTIs when a way to convert from MIMEType to UTI reliably is found. > // For now, only support PNG, JPEG, and GIF. See <rdar://problem/6095286>. > static const CFStringRef kUTTypePNG = CFSTR("public.png");
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:
oliver
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 35453
:
49638
|
49646
|
49859
| 49864