chromium/cc/layers/tile_size_calculator.cc

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

#include "cc/layers/tile_size_calculator.h"

#include <algorithm>

#include "cc/base/math_util.h"
#include "cc/layers/picture_layer_impl.h"
#include "cc/trees/layer_tree_impl.h"
#include "ui/base/ui_base_features.h"

namespace cc {
namespace {

// When making odd-sized tiles, round them up to increase the chances
// of using the same tile size.
const int kTileRoundUp =;

// Round GPU default tile sizes to a multiple of 32. This helps prevent
// rounding errors during compositing.
const int kGpuDefaultTileRoundUp =;

// For performance reasons and to support compressed tile textures, tile
// width and height should be an even multiple of 4 in size.
const int kTileMinimalAlignment =;

// This function converts the given |device_pixels_size| to the expected size
// of content which was generated to fill it at 100%.  This takes into account
// the ceil operations that occur as device pixels are converted to/from DIPs
// (content size must be a whole number of DIPs).
gfx::Size ApplyDsfAdjustment(const gfx::Size& device_pixels_size, float dsf) {}

gfx::Size AdjustGpuTileSize(int tile_width,
                            int tile_height,
                            const gfx::Size& max_tile_size,
                            int min_height_for_gpu_raster_tile) {}

// For GPU rasterization, we pick an ideal tile size using the viewport so we
// don't need any settings. The current approach uses 4 tiles to cover the
// viewport vertically.
gfx::Size CalculateGpuTileSize(const gfx::Size& base_tile_size,
                               const gfx::Size& content_bounds,
                               const gfx::Size& max_tile_size,
                               int min_height_for_gpu_raster_tile) {}

gfx::Size CalculateGpuRawDrawTileSize(const gfx::Size& base_tile_size,
                                      const gfx::Size& content_bounds,
                                      const gfx::Size& max_tile_size,
                                      int min_height_for_gpu_raster_tile,
                                      double raw_draw_tile_size_factor) {}

}  // namespace

// AffectingParams.
bool TileSizeCalculator::AffectingParams::operator==(
    const AffectingParams& other) const = default;

// TileSizeCalculator.
TileSizeCalculator::TileSizeCalculator(PictureLayerImpl* layer_impl)
    :{}

bool TileSizeCalculator::UpdateAffectingParams(gfx::Size content_bounds) {}

TileSizeCalculator::AffectingParams TileSizeCalculator::GetAffectingParams(
    gfx::Size content_bounds) const {}

gfx::Size TileSizeCalculator::CalculateTileSize(gfx::Size content_bounds) {}

}  // namespace cc