chromium/ui/views/paint_info_unittest.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/views/paint_info.h"

#include <memory>
#include <vector>

#include "base/memory/ref_counted.h"
#include "cc/base/region.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/compositor/compositor_switches.h"
#include "ui/compositor/paint_context.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"

namespace views {
namespace {

PaintInfos;

// Device scale factors
constexpr float DSF100 =;
constexpr float DSF125 =;
constexpr float DSF150 =;
constexpr float DSF160 =;
constexpr float DSF166 =;

const std::vector<float> kDsfList =;

constexpr gfx::Size kLayerSize(123, 456);

//  ___________
// |     1     |
// |___________|
// | 3 | 4 | 5 | <-- 2 (encapsulates 3, 4 and 5)
// |___|___|___|
// |   7   | 8 | <-- 6 (encapsulates 7 and 8)
// |_______|___|
//
// |r_0| encapsulates 1, 2 and 6.
const gfx::Rect r_0(kLayerSize);

constexpr gfx::Rect r_1(0, 0, 123, 152);

constexpr gfx::Rect r_2(0, 152, 123, 152);
constexpr gfx::Rect r_3(0, 0, 41, 152);
constexpr gfx::Rect r_4(41, 0, 41, 152);
constexpr gfx::Rect r_5(82, 0, 41, 152);

constexpr gfx::Rect r_6(0, 304, 123, 152);
constexpr gfx::Rect r_7(0, 0, 82, 152);
constexpr gfx::Rect r_8(82, 0, 41, 152);

// Verifies that the child recording bounds completely cover the parent
// recording bounds.
void VerifyChildBoundsCoversParent(const PaintInfo* parent_paint_info,
                                   const std::vector<PaintInfo*>& info_list) {}

void VerifyPixelCanvasCornerScaling(const PaintInfos& info_list) {}

void VerifyPixelSizesAreSameAsDIPSize(const PaintInfos& info_list) {}

}  // namespace

class PaintInfoTest : public ::testing::Test {};

TEST_F(PaintInfoTest, CornerScalingPixelCanvasEnabled) {}

TEST_F(PaintInfoTest, ScalingWithPixelCanvasDisabled) {}

TEST_F(PaintInfoTest, Invalidation) {}

// Make sure the PaintInfo used for view's layer uses the
// corderedbounds.
TEST_F(PaintInfoTest, LayerPaintInfo) {}

}  // namespace views