summaryrefslogtreecommitdiff
path: root/chromium/ui/gfx/scoped_ui_graphics_push_context_ios.mm
blob: 93cfde57d50a13ae22fdac6d2710fe7c537ac8ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/gfx/scoped_ui_graphics_push_context_ios.h"

#import <UIKit/UIKit.h>

#include "base/logging.h"

namespace gfx {

ScopedUIGraphicsPushContext::ScopedUIGraphicsPushContext(CGContextRef context)
    : context_(context) {
  UIGraphicsPushContext(context_);
}

ScopedUIGraphicsPushContext::~ScopedUIGraphicsPushContext() {
  DCHECK_EQ(context_, UIGraphicsGetCurrentContext());
  UIGraphicsPopContext();
}

}  // namespace gfx