WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-172751-20170531181932.patch (text/plain), 5.11 KB, created by
Konstantin Tokarev
on 2017-05-31 08:19:33 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Konstantin Tokarev
Created:
2017-05-31 08:19:33 PDT
Size:
5.11 KB
patch
obsolete
>Subversion Revision: 217559 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 397a38095c27f31a4e0ba1b1ceaeba904fdc6b73..59506f864906bc3788720773327d4a7ee9f5c60c 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2017-05-31 Konstantin Tokarev <annulen@yandex.ru> >+ >+ Get rid of more HIGH_DPI_CANVAS leftovers >+ https://bugs.webkit.org/show_bug.cgi?id=172751 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Get rid of HTMLCanvasElement::convertLogicalToDevice() and >+ HTMLCanvasElement::convertDeviceToLogical() that are no longer needed, >+ as canvas doesn't use device scale factor anymore. >+ >+ No new tests needed. >+ >+ * html/HTMLCanvasElement.cpp: >+ (WebCore::HTMLCanvasElement::createImageBuffer): Use integer width() >+ and height() instead of floating-point temporary deviceSize variable. >+ (WebCore::HTMLCanvasElement::baseTransform): Return unmodified >+ baseTransform of underlying ImageBuffer. >+ * html/HTMLCanvasElement.h: Removed declarations of unused methods. >+ > 2017-05-30 Brent Fulgham <bfulgham@apple.com> > > REGRESSION(r217515): Correct iterator invalidation bug (AGAIN) >diff --git a/Source/WebCore/html/HTMLCanvasElement.cpp b/Source/WebCore/html/HTMLCanvasElement.cpp >index 587121b5f6932aa6d006a2c06df7e98463abeefc..39cedd15999f2139e77897daa8df09779a4b3bfc 100644 >--- a/Source/WebCore/html/HTMLCanvasElement.cpp >+++ b/Source/WebCore/html/HTMLCanvasElement.cpp >@@ -611,36 +611,6 @@ ExceptionOr<Ref<MediaStream>> HTMLCanvasElement::captureStream(ScriptExecutionCo > } > #endif > >-FloatRect HTMLCanvasElement::convertLogicalToDevice(const FloatRect& logicalRect) const >-{ >- FloatRect deviceRect(logicalRect); >- >- float x = floorf(deviceRect.x()); >- float y = floorf(deviceRect.y()); >- float w = ceilf(deviceRect.maxX() - x); >- float h = ceilf(deviceRect.maxY() - y); >- deviceRect.setX(x); >- deviceRect.setY(y); >- deviceRect.setWidth(w); >- deviceRect.setHeight(h); >- >- return deviceRect; >-} >- >-FloatSize HTMLCanvasElement::convertLogicalToDevice(const FloatSize& logicalSize) const >-{ >- float width = ceilf(logicalSize.width()); >- float height = ceilf(logicalSize.height()); >- return FloatSize(width, height); >-} >- >-FloatSize HTMLCanvasElement::convertDeviceToLogical(const FloatSize& deviceSize) const >-{ >- float width = ceilf(deviceSize.width()); >- float height = ceilf(deviceSize.height()); >- return FloatSize(width, height); >-} >- > SecurityOrigin* HTMLCanvasElement::securityOrigin() const > { > return &document().securityOrigin(); >@@ -735,12 +705,8 @@ void HTMLCanvasElement::createImageBuffer() const > m_hasCreatedImageBuffer = true; > m_didClearImageBuffer = true; > >- FloatSize logicalSize = size(); >- FloatSize deviceSize = convertLogicalToDevice(logicalSize); >- if (!deviceSize.isExpressibleAsIntSize()) >- return; >- >- if (deviceSize.width() * deviceSize.height() > maxCanvasArea) { >+ // Perform multiplication as floating point to avoid overflow >+ if (float(width()) * height() > maxCanvasArea) { > StringBuilder stringBuilder; > stringBuilder.appendLiteral("Canvas area exceeds the maximum limit (width * height > "); > stringBuilder.appendNumber(maxCanvasArea); >@@ -760,11 +726,10 @@ void HTMLCanvasElement::createImageBuffer() const > return; > } > >- IntSize bufferSize(deviceSize.width(), deviceSize.height()); >- if (!bufferSize.width() || !bufferSize.height()) >+ if (!width() || !height()) > return; > >- RenderingMode renderingMode = shouldAccelerate(bufferSize) ? Accelerated : Unaccelerated; >+ RenderingMode renderingMode = shouldAccelerate(size()) ? Accelerated : Unaccelerated; > > setImageBuffer(ImageBuffer::create(size(), renderingMode)); > if (!m_imageBuffer) >@@ -846,13 +811,7 @@ void HTMLCanvasElement::clearCopiedImage() > AffineTransform HTMLCanvasElement::baseTransform() const > { > ASSERT(m_hasCreatedImageBuffer); >- FloatSize unscaledSize = size(); >- FloatSize deviceSize = convertLogicalToDevice(unscaledSize); >- IntSize size(deviceSize.width(), deviceSize.height()); >- AffineTransform transform; >- if (size.width() && size.height()) >- transform.scaleNonUniform(size.width() / unscaledSize.width(), size.height() / unscaledSize.height()); >- return m_imageBuffer->baseTransform() * transform; >+ return m_imageBuffer->baseTransform(); > } > > } >diff --git a/Source/WebCore/html/HTMLCanvasElement.h b/Source/WebCore/html/HTMLCanvasElement.h >index 0fac4a1018db9b8bb9feca345033aa6a31e32bcd..f9633625c5bf79984a39709f1fe4ba0f36ea4b9d 100644 >--- a/Source/WebCore/html/HTMLCanvasElement.h >+++ b/Source/WebCore/html/HTMLCanvasElement.h >@@ -133,11 +133,6 @@ public: > void makePresentationCopy(); > void clearPresentationCopy(); > >- FloatRect convertLogicalToDevice(const FloatRect&) const; >- FloatSize convertLogicalToDevice(const FloatSize&) const; >- >- FloatSize convertDeviceToLogical(const FloatSize&) const; >- > SecurityOrigin* securityOrigin() const; > void setOriginTainted() { m_originClean = false; } > bool originClean() const { return m_originClean; }
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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 172751
: 311590