diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-08-30 10:22:43 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-08-30 12:36:28 +0000 |
commit | 271a6c3487a14599023a9106329505597638d793 (patch) | |
tree | e040d58ffc86c1480b79ca8528020ca9ec919bf8 /chromium/cc/layers/tile_size_calculator.h | |
parent | 7b2ffa587235a47d4094787d72f38102089f402a (diff) |
BASELINE: Update Chromium to 77.0.3865.59
Change-Id: I1e89a5f3b009a9519a6705102ad65c92fe736f21
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/cc/layers/tile_size_calculator.h')
-rw-r--r-- | chromium/cc/layers/tile_size_calculator.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/chromium/cc/layers/tile_size_calculator.h b/chromium/cc/layers/tile_size_calculator.h new file mode 100644 index 00000000000..cd455b922d2 --- /dev/null +++ b/chromium/cc/layers/tile_size_calculator.h @@ -0,0 +1,50 @@ +// Copyright 2019 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. + +#ifndef CC_LAYERS_TILE_SIZE_CALCULATOR_H_ +#define CC_LAYERS_TILE_SIZE_CALCULATOR_H_ + +#include "cc/cc_export.h" +#include "ui/gfx/geometry/size.h" + +namespace cc { + +class PictureLayerImpl; + +// This class calculates the tile size only when the |affecting_params_| +// or |content_bounds_| is changed. +class CC_EXPORT TileSizeCalculator { + public: + explicit TileSizeCalculator(PictureLayerImpl* layer_impl); + + gfx::Size CalculateTileSize(); + + private: + struct AffectingParams { + int max_texture_size = 0; + bool use_gpu_rasterization = false; + float device_scale_factor = 0.0f; + gfx::Size max_tile_size; + gfx::Size gpu_raster_max_texture_size; + gfx::Size max_untiled_layer_size; + gfx::Size default_tile_size; + gfx::Size layer_content_bounds; + + bool operator==(const AffectingParams& other); + }; + + PictureLayerImpl* layer_impl() const { return layer_impl_; } + AffectingParams GetAffectingParams(); + bool IsAffectingParamsChanged(); + + PictureLayerImpl* layer_impl_; + + AffectingParams affecting_params_; + + gfx::Size tile_size_; +}; + +} // namespace cc + +#endif // CC_LAYERS_TILE_SIZE_CALCULATOR_H_ |