Bug 858292 - Preserve drawing buffer when using SkiaGL r=gwright
authorJames Willcox <snorp@snorp.net>
Mon, 29 Apr 2013 10:00:32 -0400
changeset 130217 16f3bfd127f9cb758e76badb6c5b5b80659b1a5e
parent 130216 44cfaf0cc991d3003e7ec25ba513c546f2df85b4
child 130218 0a193912cf7f1380ff9c72954cf608885235102f
push id24605
push userkwierso@gmail.com
push dateMon, 29 Apr 2013 21:47:00 +0000
treeherdermozilla-central@dd0c611a0a27 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgwright
bugs858292
milestone23.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 858292 - Preserve drawing buffer when using SkiaGL r=gwright
content/canvas/src/CanvasRenderingContext2D.cpp
--- a/content/canvas/src/CanvasRenderingContext2D.cpp
+++ b/content/canvas/src/CanvasRenderingContext2D.cpp
@@ -785,19 +785,22 @@ CanvasRenderingContext2D::EnsureTarget()
     if (ownerDoc) {
       layerManager =
         nsContentUtils::PersistentLayerManagerForDocument(ownerDoc);
     }
 
      if (layerManager) {
 #ifdef USE_SKIA_GPU
        if (gfxPlatform::GetPlatform()->UseAcceleratedSkiaCanvas()) {
+         SurfaceCaps caps = SurfaceCaps::ForRGBA();
+         caps.preserve = true;
+
          mGLContext = mozilla::gl::GLContextProvider::CreateOffscreen(gfxIntSize(size.width,
                                                                                  size.height),
-                                                                      SurfaceCaps::ForRGBA(),
+                                                                      caps,
                                                                       mozilla::gl::GLContext::ContextFlagsNone);
          mTarget = gfxPlatform::GetPlatform()->CreateDrawTargetForFBO(0, mGLContext, size, format);
        } else
 #endif
          mTarget = layerManager->CreateDrawTarget(size, format);
      } else {
        mTarget = gfxPlatform::GetPlatform()->CreateOffscreenDrawTarget(size, format);
      }