1// Copyright (c) 2012 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5#include "ui/gfx/scoped_ui_graphics_push_context_ios.h" 6 7#import <UIKit/UIKit.h> 8 9#include "base/logging.h" 10 11namespace gfx { 12 13ScopedUIGraphicsPushContext::ScopedUIGraphicsPushContext(CGContextRef context) 14 : context_(context) { 15 UIGraphicsPushContext(context_); 16} 17 18ScopedUIGraphicsPushContext::~ScopedUIGraphicsPushContext() { 19 DCHECK_EQ(context_, UIGraphicsGetCurrentContext()); 20 UIGraphicsPopContext(); 21} 22 23} // namespace gfx 24