Bug 981857 - Make DrawTargetCG::CopySurface() support data surfaces. r=jrmuizel
authorJonathan Watt <jwatt@jwatt.org>
Tue, 11 Mar 2014 07:24:43 +0000
changeset 190123 fb992b5cb0caa92e5af1239fd53b370408bda2ac
parent 190122 9984a46fc9389746830f056bdb2f3d3f9d52d805
child 190124 14e185bc3ef8dd65c346c6be510e0bec6429ad1d
push id3503
push userraliiev@mozilla.com
push dateMon, 28 Apr 2014 18:51:11 +0000
treeherdermozilla-beta@c95ac01e332e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs981857
milestone30.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 981857 - Make DrawTargetCG::CopySurface() support data surfaces. r=jrmuizel
gfx/2d/DrawTargetCG.cpp
--- a/gfx/2d/DrawTargetCG.cpp
+++ b/gfx/2d/DrawTargetCG.cpp
@@ -1202,17 +1202,18 @@ CGContextResetClip(CGContextRef);
 void
 DrawTargetCG::CopySurface(SourceSurface *aSurface,
                           const IntRect& aSourceRect,
                           const IntPoint &aDestination)
 {
   MarkChanged();
 
   if (aSurface->GetType() == SurfaceType::COREGRAPHICS_IMAGE ||
-      aSurface->GetType() == SurfaceType::COREGRAPHICS_CGCONTEXT) {
+      aSurface->GetType() == SurfaceType::COREGRAPHICS_CGCONTEXT ||
+      aSurface->GetType() == SurfaceType::DATA) {
     CGImageRef image = GetRetainedImageFromSourceSurface(aSurface);
 
     /* we have two options here:
      *  - create a subimage -- this is slower
      *  - fancy things with clip and different dest rects */
     CGImageRef subimage = CGImageCreateWithImageInRect(image, IntRectToCGRect(aSourceRect));
     CGImageRelease(image);
     // XXX: it might be more efficient for us to do the copy directly if we have access to the bits