From 8f19e4bc617d19e871137be55a34992e421585ad Mon Sep 17 00:00:00 2001 From: weili Date: Thu, 21 Jul 2016 23:26:47 -0700 Subject: Fix skia build broken by commit c38cd6 Add back one function which is only used by Skia code. And make a couple small fixes. Review-Url: https://codereview.chromium.org/2167383002 --- core/fxge/ge/fx_ge_device.cpp | 6 ++++++ core/fxge/include/fx_ge.h | 1 + core/fxge/skia/fx_skia_device.cpp | 10 +++++----- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/core/fxge/ge/fx_ge_device.cpp b/core/fxge/ge/fx_ge_device.cpp index 571f90cfa1..2f4e0a0eec 100644 --- a/core/fxge/ge/fx_ge_device.cpp +++ b/core/fxge/ge/fx_ge_device.cpp @@ -21,6 +21,12 @@ CFX_RenderDevice::CFX_RenderDevice() CFX_RenderDevice::~CFX_RenderDevice() {} +#ifdef _SKIA_SUPPORT_ +void CFX_RenderDevice::Flush() { + m_pDeviceDriver.reset(); +} +#endif + void CFX_RenderDevice::SetDeviceDriver( std::unique_ptr pDriver) { m_pDeviceDriver = std::move(pDriver); diff --git a/core/fxge/include/fx_ge.h b/core/fxge/include/fx_ge.h index aceaa76a94..ce2f9d37e2 100644 --- a/core/fxge/include/fx_ge.h +++ b/core/fxge/include/fx_ge.h @@ -382,6 +382,7 @@ class CFX_RenderDevice { #ifdef _SKIA_SUPPORT_ virtual void DebugVerifyBitmapIsPreMultiplied() const; + void Flush(); #endif private: diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp index 5f874e5ffb..3c7ce7ee98 100644 --- a/core/fxge/skia/fx_skia_device.cpp +++ b/core/fxge/skia/fx_skia_device.cpp @@ -1462,7 +1462,8 @@ CFX_FxgeDevice::CFX_FxgeDevice() { } SkPictureRecorder* CFX_FxgeDevice::CreateRecorder(int size_x, int size_y) { - SetDeviceDriver(WrapUnique(new CFX_SkiaDeviceDriver(size_x, size_y))); + CFX_SkiaDeviceDriver* skDriver = new CFX_SkiaDeviceDriver(size_x, size_y); + SetDeviceDriver(WrapUnique(skDriver)); return skDriver->GetRecorder(); } @@ -1481,7 +1482,7 @@ bool CFX_FxgeDevice::Attach(CFX_DIBitmap* pBitmap, bool CFX_FxgeDevice::AttachRecorder(SkPictureRecorder* recorder) { if (!recorder) return false; - SetDeviceDriver(new CFX_SkiaDeviceDriver(recorder)); + SetDeviceDriver(WrapUnique(new CFX_SkiaDeviceDriver(recorder))); return true; } @@ -1496,9 +1497,8 @@ bool CFX_FxgeDevice::Create(int width, return false; } SetBitmap(pBitmap); - CFX_SkiaDeviceDriver* pDriver = - new CFX_SkiaDeviceDriver(pBitmap, FALSE, pOriDevice, FALSE); - SetDeviceDriver(pDriver); + SetDeviceDriver( + WrapUnique(new CFX_SkiaDeviceDriver(pBitmap, FALSE, pOriDevice, FALSE))); return true; } -- cgit v1.2.3