Bug 1059033 - Part 5: Implement OptimizeSourceSurface for DrawTargetCG. r=Bas
authorMatt Woodrow <mwoodrow@mozilla.com>
Wed, 03 Sep 2014 09:21:14 +1200
changeset 203275 7dbb91002381673fd0e35febd0aceb2e7a99b973
parent 203274 e96c73e49d5869941c14fc5e42b20b7e114d3e7a
child 203276 2bea22f534f00ef45c0e694a6e0d1c794ec287a8
push id27425
push userryanvm@gmail.com
push dateWed, 03 Sep 2014 20:38:59 +0000
treeherdermozilla-central@acbdce59da2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBas
bugs1059033
milestone35.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 1059033 - Part 5: Implement OptimizeSourceSurface for DrawTargetCG. r=Bas
gfx/2d/DrawTargetCG.cpp
--- a/gfx/2d/DrawTargetCG.cpp
+++ b/gfx/2d/DrawTargetCG.cpp
@@ -249,17 +249,22 @@ GetRetainedImageFromSourceSurface(Source
 
 TemporaryRef<SourceSurface>
 DrawTargetCG::OptimizeSourceSurface(SourceSurface *aSurface) const
 {
   if (aSurface->GetType() == SurfaceType::COREGRAPHICS_IMAGE ||
       aSurface->GetType() == SurfaceType::COREGRAPHICS_CGCONTEXT) {
     return aSurface;
   }
-  return aSurface->GetDataSurface();
+  RefPtr<DataSourceSurface> data = aSurface->GetDataSurface();
+
+  return CreateSourceSurfaceFromData(data->GetData(),
+                                     data->GetSize(),
+                                     data->Stride(),
+                                     data->GetFormat());
 }
 
 class UnboundnessFixer
 {
     CGRect mClipBounds;
     CGLayerRef mLayer;
     CGContextRef mCg;
   public: