Bug 1059033 - Part 5: Implement OptimizeSourceSurface for DrawTargetCG. r=Bas
☠☠ backed out by 6cddb4cf40e3 ☠ ☠
authorMatt Woodrow <mwoodrow@mozilla.com>
Mon, 01 Sep 2014 15:23:21 +1200
changeset 224475 3e4105ea0a73383df0ac5dcc783273710502985c
parent 224474 e59430ea4256cd00c59a73b8a7992b62b9128113
child 224476 dc8dc49bba25a56e71ddb932dfd95b701db11eb9
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [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: