Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Unified Diff: ui/gfx/mac/io_surface.cc

Issue 1825283003: [Merge to 2623] Disable IOSurface clearing on OS X 10.9. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2623
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/gl/test/gl_image_test_template.h » ('j') | ui/gl/test/gl_image_test_template.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/mac/io_surface.cc
diff --git a/ui/gfx/mac/io_surface.cc b/ui/gfx/mac/io_surface.cc
index e6079c7a2b1cc4045be6ca4a1de3ac760b831d1c..e48a813ad42e020beb03a6da3f3e6b6c48f77445 100644
--- a/ui/gfx/mac/io_surface.cc
+++ b/ui/gfx/mac/io_surface.cc
@@ -8,6 +8,7 @@
#include <stdint.h>
#include "base/logging.h"
+#include "base/mac/mac_util.h"
#include "base/mac/mach_logging.h"
#include "base/macros.h"
#include "ui/gfx/buffer_format_util.h"
@@ -150,12 +151,18 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size, gfx::BufferFormat format) {
IOSurfaceRef surface = IOSurfaceCreate(properties);
- // Zero-initialize the IOSurface. Calling IOSurfaceLock/IOSurfaceUnlock
- // appears to be sufficient. https://crbug.com/584760#c17
- IOReturn r = IOSurfaceLock(surface, 0, nullptr);
- DCHECK_EQ(kIOReturnSuccess, r);
- r = IOSurfaceUnlock(surface, 0, nullptr);
- DCHECK_EQ(kIOReturnSuccess, r);
+ // For unknown reasons, triggering this lock on OS X 10.9, on certain GPUs,
+ // causes PDFs to render incorrectly. Hopefully this check can be removed once
+ // pdfium switches to a Skia backend on Mac.
+ // https://crbug.com/594343.
+ if (!base::mac::IsOSMavericks()) {
+ // Zero-initialize the IOSurface. Calling IOSurfaceLock/IOSurfaceUnlock
+ // appears to be sufficient. https://crbug.com/584760#c17
+ IOReturn r = IOSurfaceLock(surface, 0, nullptr);
+ DCHECK_EQ(kIOReturnSuccess, r);
+ r = IOSurfaceUnlock(surface, 0, nullptr);
+ DCHECK_EQ(kIOReturnSuccess, r);
+ }
return surface;
}
« no previous file with comments | « no previous file | ui/gl/test/gl_image_test_template.h » ('j') | ui/gl/test/gl_image_test_template.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698