#include <stddef.h>
#include <algorithm>
#include <memory>
#include <utility>
#include "base/numerics/safe_conversions.h"
#include "cc/layers/append_quads_data.h"
#include "cc/layers/nine_patch_layer_impl.h"
#include "cc/resources/ui_resource_bitmap.h"
#include "cc/resources/ui_resource_client.h"
#include "cc/test/fake_impl_task_runner_provider.h"
#include "cc/test/fake_layer_tree_frame_sink.h"
#include "cc/test/fake_ui_resource_layer_tree_host_impl.h"
#include "cc/test/layer_tree_impl_test_base.h"
#include "cc/trees/single_thread_proxy.h"
#include "components/viz/common/quads/texture_draw_quad.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/transform.h"
namespace cc {
namespace {
gfx::Rect ToRoundedIntRect(const gfx::RectF& rect_f) { … }
void NinePatchLayerLayoutTest(const gfx::Size& bitmap_size,
const gfx::Rect& aperture_rect,
const gfx::Size& layer_size,
const gfx::Rect& border,
bool fill_center,
size_t expected_quad_size) { … }
void NinePatchLayerLayoutTestWithOcclusion(const gfx::Size& bitmap_size,
const gfx::Rect& aperture_rect,
const gfx::Size& layer_size,
const gfx::Rect& border,
const gfx::Rect& occlusion,
bool fill_center,
size_t expected_quad_size) { … }
TEST(NinePatchLayerImplTest, VerifyDrawQuads) { … }
TEST(NinePatchLayerImplTest, VerifyDrawQuadsWithOcclusion) { … }
TEST(NinePatchLayerImplTest, VerifyDrawQuadsWithEmptyPatches) { … }
TEST(NinePatchLayerImplTest, Occlusion) { … }
TEST(NinePatchLayerImplTest, OpaqueRect) { … }
}
}