Bug 995832 - Make DrawTargetSkia::DrawSurface accept any surface type. r=gw280
authorJonathan Watt <jwatt@jwatt.org>
Tue, 15 Apr 2014 13:55:48 +0100
changeset 197057 44e4463a8eebe49ea1a0a8b7a1343967bb7b7298
parent 197056 cd8469d0dd5e8ea02dee13c49361ab0220dd3ca4
child 197058 191b0a9e66643250fe5cad9f32a451d2db6f0cbc
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgw280
bugs995832
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 995832 - Make DrawTargetSkia::DrawSurface accept any surface type. r=gw280
gfx/2d/DrawTargetSkia.cpp
--- a/gfx/2d/DrawTargetSkia.cpp
+++ b/gfx/2d/DrawTargetSkia.cpp
@@ -304,18 +304,25 @@ DrawTargetSkia::Flush()
 
 void
 DrawTargetSkia::DrawSurface(SourceSurface *aSurface,
                             const Rect &aDest,
                             const Rect &aSource,
                             const DrawSurfaceOptions &aSurfOptions,
                             const DrawOptions &aOptions)
 {
+  RefPtr<SourceSurface> dataSurface;
+
   if (!(aSurface->GetType() == SurfaceType::SKIA || aSurface->GetType() == SurfaceType::DATA)) {
-    return;
+    dataSurface = aSurface->GetDataSurface();
+    if (!dataSurface) {
+      gfxDebug() << *this << ": DrawSurface() can't draw surface";
+      return;
+    }
+    aSurface = dataSurface.get();
   }
 
   if (aSource.IsEmpty()) {
     return;
   }
 
   MarkChanged();