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

Unified Diff: skia/ext/skia_utils_mac.mm

Issue 2086543002: Move releaseIfNeeded to start, since it can change bitmapIsDummy_ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/skia_utils_mac.mm
diff --git a/skia/ext/skia_utils_mac.mm b/skia/ext/skia_utils_mac.mm
index 0a6be68a91bf125fbd40c430c4e54cda1406cf6f..1718551735087ad478827dc4a95f23f4fbbb9975 100644
--- a/skia/ext/skia_utils_mac.mm
+++ b/skia/ext/skia_utils_mac.mm
@@ -312,6 +312,8 @@ void SkiaBitLocker::releaseIfNeeded() {
}
CGContextRef SkiaBitLocker::cgContext() {
+ releaseIfNeeded(); // This flushes any prior bitmap use
+
SkIRect clip_bounds;
if (!canvas_->getClipDeviceBounds(&clip_bounds)) {
// If the clip is empty, then there is nothing to draw. The caller may
@@ -321,8 +323,6 @@ CGContextRef SkiaBitLocker::cgContext() {
clip_bounds = SkIRect::MakeXYWH(0, 0, 1, 1);
}
- releaseIfNeeded(); // This flushes any prior bitmap use
-
// remember the top/left, in case we need to compose this later
bitmapOffset_.set(clip_bounds.x(), clip_bounds.y());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698