Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp |
| diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp |
| index 7862cd262a40d36646522d6a687ab9447d659d0a..fdfcea78e7eabbae418c9a3f2be5cad23a272044 100644 |
| --- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp |
| +++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp |
| @@ -111,7 +111,6 @@ inline HTMLCanvasElement::HTMLCanvasElement(Document& document) |
| , DocumentVisibilityObserver(document) |
| , m_size(DefaultWidth, DefaultHeight) |
| , m_ignoreReset(false) |
| - , m_accelerationDisabled(false) |
| , m_externallyAllocatedMemory(0) |
| , m_originClean(true) |
| , m_didFailToCreateImageBuffer(false) |
| @@ -126,8 +125,6 @@ HTMLCanvasElement::~HTMLCanvasElement() |
| { |
| v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-m_externallyAllocatedMemory); |
| #if !ENABLE(OILPAN) |
| - for (CanvasObserver* canvasObserver : m_observers) |
| - canvasObserver->canvasDestroyed(this); |
| // Ensure these go away before the ImageBuffer. |
| m_context.clear(); |
| #endif |
| @@ -181,16 +178,6 @@ Node::InsertionNotificationRequest HTMLCanvasElement::insertedInto(ContainerNode |
| return HTMLElement::insertedInto(node); |
| } |
| -void HTMLCanvasElement::addObserver(CanvasObserver* observer) |
| -{ |
| - m_observers.add(observer); |
| -} |
| - |
| -void HTMLCanvasElement::removeObserver(CanvasObserver* observer) |
| -{ |
| - m_observers.remove(observer); |
| -} |
| - |
| void HTMLCanvasElement::setHeight(int value) |
| { |
| setIntegralAttribute(heightAttr, value); |
| @@ -298,7 +285,6 @@ void HTMLCanvasElement::didDraw(const FloatRect& rect) |
| m_dirtyRect.unite(rect); |
| if (m_context && m_context->is2d() && hasImageBuffer()) |
| buffer()->didDraw(rect); |
| - notifyObserversCanvasChanged(rect); |
| } |
| void HTMLCanvasElement::didFinalizeFrame() |
| @@ -355,12 +341,6 @@ void HTMLCanvasElement::doDeferredPaintInvalidation() |
| ASSERT(m_dirtyRect.isEmpty()); |
| } |
| -void HTMLCanvasElement::notifyObserversCanvasChanged(const FloatRect& rect) |
| -{ |
| - for (CanvasObserver* canvasObserver : m_observers) |
| - canvasObserver->canvasChanged(this, rect); |
| -} |
| - |
| void HTMLCanvasElement::reset() |
| { |
| if (m_ignoreReset) |
| @@ -411,9 +391,6 @@ void HTMLCanvasElement::reset() |
| layoutObject->setShouldDoFullPaintInvalidation(); |
| } |
| } |
| - |
| - for (CanvasObserver* canvasObserver : m_observers) |
| - canvasObserver->canvasResized(this); |
| } |
| bool HTMLCanvasElement::paintsIntoCanvasBuffer() const |
| @@ -630,9 +607,6 @@ bool HTMLCanvasElement::shouldAccelerate(const IntSize& size) const |
| if (m_context && !m_context->is2d()) |
| return false; |
| - if (m_accelerationDisabled) |
| - return false; |
| - |
| if (RuntimeEnabledFeatures::forceDisplayList2dCanvasEnabled()) |
| return false; |
| @@ -695,13 +669,9 @@ PassOwnPtr<ImageBufferSurface> HTMLCanvasElement::createImageBufferSurface(const |
| *msaaSampleCount = 0; |
| if (is3D()) { |
| // If 3d, but the use of the canvas will be for non-accelerated content |
| - // (such as -webkit-canvas, then then make a non-accelerated |
| + // then make a non-accelerated |
|
pdr.
2015/10/23 18:23:55
Nit: This looks weird on my 80 column punchcards.
chrishtr
2015/10/23 19:47:06
Done.
|
| // ImageBuffer. This means copying the internal Image will require a |
| // pixel readback, but that is unavoidable in this case. |
| - // FIXME: Actually, avoid setting m_accelerationDisabled at all when |
| - // doing GPU-based rasterization. |
| - if (m_accelerationDisabled) |
| - return adoptPtr(new UnacceleratedImageBufferSurface(deviceSize, opacityMode)); |
| return adoptPtr(new AcceleratedImageBufferSurface(deviceSize, opacityMode)); |
| } |