Chromium Code Reviews| Index: ui/gfx/mac/io_surface.cc |
| diff --git a/ui/gfx/mac/io_surface.cc b/ui/gfx/mac/io_surface.cc |
| index 8c748bca1846623b73902095adf8688df99598e8..e4df515d6c463d52e695af6d7299b474a2e4a089 100644 |
| --- a/ui/gfx/mac/io_surface.cc |
| +++ b/ui/gfx/mac/io_surface.cc |
| @@ -148,7 +148,17 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size, gfx::BufferFormat format) { |
| BytesPerElement(format, 0)); |
| } |
| - return IOSurfaceCreate(properties); |
| + IOSurfaceRef surface = IOSurfaceCreate(properties); |
| + |
| + // Zero-initialize the texture. Calling IOSurfaceLock/IOSurfaceUnlock appears |
|
reveman
2016/02/17 19:21:51
nit: s/texture/IOSurface/
erikchen
2016/02/17 19:23:55
Done.
|
| + // to be sufficient. |
| + // https://code.google.com/p/chromium/issues/detail?id=584760#c17 |
| + IOReturn r = IOSurfaceLock(surface, 0, nullptr); |
| + DCHECK_EQ(kIOReturnSuccess, r); |
| + r = IOSurfaceUnlock(surface, 0, nullptr); |
| + DCHECK_EQ(kIOReturnSuccess, r); |
| + |
| + return surface; |
| } |
| } // namespace gfx |