Bug 980885 - Fix more Moz2D D2D mapping code that fails to set/reset mIsMapped. r=Bas CLOSED TREE to fix orange
authorJonathan Watt <jwatt@jwatt.org>
Fri, 07 Mar 2014 14:55:16 +0000
changeset 189756 7e787cc4649e09ddb02af25815bb0211ddd9c9f3
parent 189755 952d40249eea2f0ea15f549bfe03786b6b2cb216
child 189757 2f3539fc3c685025b346d5ec550801a619b9544d
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)
reviewersBas
bugs980885
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 980885 - Fix more Moz2D D2D mapping code that fails to set/reset mIsMapped. r=Bas CLOSED TREE to fix orange
gfx/2d/SourceSurfaceD2D1.cpp
gfx/2d/SourceSurfaceD2DTarget.cpp
--- a/gfx/2d/SourceSurfaceD2D1.cpp
+++ b/gfx/2d/SourceSurfaceD2D1.cpp
@@ -162,16 +162,19 @@ DataSourceSurfaceD2D1::Map(MapType aMapT
 
   mIsMapped = true;
   return true;
 }
 
 void
 DataSourceSurfaceD2D1::Unmap()
 {
+  MOZ_ASSERT(mIsMapped);
+
+  mIsMapped = false;
   mBitmap->Unmap();
 }
 
 int32_t
 DataSourceSurfaceD2D1::Stride()
 {
   EnsureMapped();
 
--- a/gfx/2d/SourceSurfaceD2DTarget.cpp
+++ b/gfx/2d/SourceSurfaceD2DTarget.cpp
@@ -268,25 +268,27 @@ DataSourceSurfaceD2DTarget::Map(MapType 
 
   if (FAILED(hr)) {
     gfxWarning() << "Texture map failed with code: " << hr;
     return false;
   }
 
   aMappedSurface->mData = (uint8_t*)map.pData;
   aMappedSurface->mStride = map.RowPitch;
+  mIsMapped = true;
 
   return true;
 }
 
 void
 DataSourceSurfaceD2DTarget::Unmap()
 {
   MOZ_ASSERT(mIsMapped);
 
+  mIsMapped = false;
   mTexture->Unmap(0);
 }
 
 void
 DataSourceSurfaceD2DTarget::EnsureMapped()
 {
   // Do not use GetData() after having used Map!
   MOZ_ASSERT(!mIsMapped);