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

Unified Diff: third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp

Issue 2833593002: Remove unneeded abstractions and simplify RecordingImageBufferSurface (Closed)
Patch Set: imagebuffersurface-cleanups: morefixcompile Created 3 years, 8 months 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
Index: third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp b/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
index bb1a4cc7d82ea8b979225031a5267e6feb474deb..99379a0a4a6627ac0dc0299563e24b3cbbd97516 100644
--- a/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
@@ -525,35 +525,15 @@ void ImageBuffer::UpdateGPUMemoryUsage() const {
}
}
-namespace {
-
-class UnacceleratedSurfaceFactory
- : public RecordingImageBufferFallbackSurfaceFactory {
- public:
- virtual std::unique_ptr<ImageBufferSurface> CreateSurface(
- const IntSize& size,
- OpacityMode opacity_mode,
- const CanvasColorParams& color_params) {
- return WTF::WrapUnique(new UnacceleratedImageBufferSurface(
- size, opacity_mode, kInitializeImagePixels, color_params));
- }
-
- virtual ~UnacceleratedSurfaceFactory() {}
-};
-
-} // namespace
-
void ImageBuffer::DisableAcceleration() {
if (!IsAccelerated())
return;
// Create and configure a recording (unaccelerated) surface.
- std::unique_ptr<RecordingImageBufferFallbackSurfaceFactory> surface_factory =
- WTF::MakeUnique<UnacceleratedSurfaceFactory>();
std::unique_ptr<ImageBufferSurface> surface =
WTF::WrapUnique(new RecordingImageBufferSurface(
- surface_->size(), std::move(surface_factory),
- surface_->GetOpacityMode(), surface_->color_params()));
+ surface_->size(), surface_->GetOpacityMode(),
+ surface_->color_params()));
SetSurface(std::move(surface));
}

Powered by Google App Engine
This is Rietveld 408576698