Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1540)

Unified Diff: Source/core/rendering/FilterEffectRenderer.cpp

Issue 104023007: Refactoring ImageBuffer to decouple it from Canvas2DLayerBridge (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase mayhem Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/platform/animation/AnimationTranslationUtil.h ('k') | Source/core/rendering/RenderLayer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/FilterEffectRenderer.cpp
diff --git a/Source/core/rendering/FilterEffectRenderer.cpp b/Source/core/rendering/FilterEffectRenderer.cpp
index a4e007a87e22ad66e9924dcc302a180b43cca1a8..ff60e9b0d76bafa0a793130f70f85b16a2c9b00a 100644
--- a/Source/core/rendering/FilterEffectRenderer.cpp
+++ b/Source/core/rendering/FilterEffectRenderer.cpp
@@ -40,6 +40,7 @@
#include "platform/FloatConversion.h"
#include "platform/LengthFunctions.h"
#include "platform/graphics/ColorSpace.h"
+#include "platform/graphics/UnacceleratedImageBufferSurface.h"
#include "platform/graphics/filters/FEColorMatrix.h"
#include "platform/graphics/filters/FEComponentTransfer.h"
#include "platform/graphics/filters/FEDropShadow.h"
@@ -48,6 +49,7 @@
#include "platform/graphics/filters/custom/CustomFilterValidatedProgram.h"
#include "platform/graphics/filters/custom/FECustomFilter.h"
#include "platform/graphics/filters/custom/ValidatedCustomFilterOperation.h"
+#include "platform/graphics/gpu/AcceleratedImageBufferSurface.h"
#include "wtf/MathExtras.h"
#include <algorithm>
@@ -311,8 +313,16 @@ void FilterEffectRenderer::allocateBackingStoreIfNeeded()
// buffer if we have not yet done so.
if (!m_graphicsBufferAttached) {
IntSize logicalSize(m_sourceDrawingRegion.width(), m_sourceDrawingRegion.height());
- if (!sourceImage() || sourceImage()->logicalSize() != logicalSize)
- setSourceImage(ImageBuffer::create(logicalSize, 1, renderingMode()));
+ if (!sourceImage() || sourceImage()->size() != logicalSize) {
+ OwnPtr<ImageBufferSurface> surface;
+ if (isAccelerated()) {
+ surface = adoptPtr(new AcceleratedImageBufferSurface(logicalSize));
+ }
+ if (!surface || !surface->isValid()) {
+ surface = adoptPtr(new UnacceleratedImageBufferSurface(logicalSize));
+ }
+ setSourceImage(ImageBuffer::create(surface.release()));
+ }
m_graphicsBufferAttached = true;
}
}
« no previous file with comments | « Source/core/platform/animation/AnimationTranslationUtil.h ('k') | Source/core/rendering/RenderLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698