blob: 10f4bddbfc2f9ad0de97115267ffa68c3221aedd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
// Copyright 2014 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/base/test/ios/ui_view_test_utils.h"
#include "base/logging.h"
namespace ui {
namespace test {
namespace uiview_utils {
void ForceViewRendering(UIView* view) {
DCHECK(view);
CALayer* layer = view.layer;
DCHECK(layer);
// 19 is an arbitrary non-zero value.
UIGraphicsBeginImageContext(CGSizeMake(19, 19));
CGContext* context = UIGraphicsGetCurrentContext();
DCHECK(context);
[layer renderInContext:context];
UIGraphicsEndImageContext();
}
} // namespace uiview_utils
} // namespace test
} // namespace ui
|