blob: e8534cacb33c8c9d048147a49a4c228599d7f879 [file] [log] [blame]
robertphillips@google.com770963f2014-04-18 18:04:41 +00001/*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#include "SkBBHFactory.h"
bungemand3ebb482015-08-05 13:57:49 -07009#include "SkRect.h"
robertphillips@google.com770963f2014-04-18 18:04:41 +000010#include "SkRTree.h"
bungemand3ebb482015-08-05 13:57:49 -070011#include "SkScalar.h"
robertphillips@google.com770963f2014-04-18 18:04:41 +000012
reed78e27682014-11-19 08:04:34 -080013SkBBoxHierarchy* SkRTreeFactory::operator()(const SkRect& bounds) const {
14 SkScalar aspectRatio = bounds.width() / bounds.height();
halcanary385fe4d2015-08-26 13:07:48 -070015 return new SkRTree(aspectRatio);
robertphillips@google.com770963f2014-04-18 18:04:41 +000016}