Bug 1059033 - Part 5: Implement OptimizeSourceSurface for DrawTargetCG. r=Bas
☠☠ backed out by 21b1152c66cc ☠ ☠
authorMatt Woodrow <mwoodrow@mozilla.com>
Tue, 02 Sep 2014 12:35:32 +1200
changeset 202846 bb3885b57d4853d06e635a8364e045eaae3dc498
parent 202845 76897f52ac2cb6b5a4b86279109a7de6dea82dc9
child 202847 07b3695aa02f162db0614396a3896976f58113a4
push id48512
push usermwoodrow@mozilla.com
push dateTue, 02 Sep 2014 00:38:50 +0000
treeherdermozilla-inbound@4df1bd30364d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBas
bugs1059033
milestone34.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: