summaryrefslogtreecommitdiff
path: root/chromium/cc/raster
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/cc/raster
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/cc/raster')
-rw-r--r--chromium/cc/raster/gpu_raster_buffer_provider.cc1
-rw-r--r--chromium/cc/raster/playback_image_provider.cc13
-rw-r--r--chromium/cc/raster/playback_image_provider.h4
-rw-r--r--chromium/cc/raster/raster_source.cc12
-rw-r--r--chromium/cc/raster/raster_source.h22
-rw-r--r--chromium/cc/raster/scoped_gpu_raster.h1
-rw-r--r--chromium/cc/raster/staging_buffer_pool.cc6
-rw-r--r--chromium/cc/raster/task_graph_runner.h1
8 files changed, 37 insertions, 23 deletions
diff --git a/chromium/cc/raster/gpu_raster_buffer_provider.cc b/chromium/cc/raster/gpu_raster_buffer_provider.cc
index aec0c26256c..4dbb25b4d81 100644
--- a/chromium/cc/raster/gpu_raster_buffer_provider.cc
+++ b/chromium/cc/raster/gpu_raster_buffer_provider.cc
@@ -9,6 +9,7 @@
#include <algorithm>
#include <utility>
+#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/rand_util.h"
#include "base/strings/stringprintf.h"
diff --git a/chromium/cc/raster/playback_image_provider.cc b/chromium/cc/raster/playback_image_provider.cc
index cbda15cb848..103382658e9 100644
--- a/chromium/cc/raster/playback_image_provider.cc
+++ b/chromium/cc/raster/playback_image_provider.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "cc/tiles/image_decode_cache.h"
+#include "gpu/command_buffer/common/mailbox.h"
namespace cc {
namespace {
@@ -57,9 +58,15 @@ ImageProvider::ScopedResult PlaybackImageProvider::GetRasterContent(
DrawImage adjusted_image(draw_image, 1.f, frame_index, target_color_space_);
if (!cache_->UseCacheForDrawImage(adjusted_image)) {
- return ScopedResult(DecodedDrawImage(
- paint_image.GetSkImage(), SkSize::Make(0, 0), SkSize::Make(1.f, 1.f),
- draw_image.filter_quality(), true /* is_budgeted */));
+ if (settings_->use_oop_raster) {
+ return ScopedResult(DecodedDrawImage(paint_image.GetMailbox(),
+ draw_image.filter_quality()));
+ } else {
+ return ScopedResult(
+ DecodedDrawImage(paint_image.GetRasterSkImage(), SkSize::Make(0, 0),
+ SkSize::Make(1.f, 1.f), draw_image.filter_quality(),
+ true /* is_budgeted */));
+ }
}
auto decoded_draw_image = cache_->GetDecodedImageForDraw(adjusted_image);
diff --git a/chromium/cc/raster/playback_image_provider.h b/chromium/cc/raster/playback_image_provider.h
index 70991ca2692..1f0f1084fd6 100644
--- a/chromium/cc/raster/playback_image_provider.h
+++ b/chromium/cc/raster/playback_image_provider.h
@@ -33,6 +33,10 @@ class CC_EXPORT PlaybackImageProvider : public ImageProvider {
// The frame index to use for the given image id. If no index is provided,
// the frame index provided in the PaintImage will be used.
base::flat_map<PaintImage::Id, size_t> image_to_current_frame_index;
+
+ // Indicates that the consumer of decoded images is paint serialization
+ // for OOP raster.
+ bool use_oop_raster = false;
};
// If no settings are provided, all images are skipped during rasterization.
diff --git a/chromium/cc/raster/raster_source.cc b/chromium/cc/raster/raster_source.cc
index 99d6d88018a..73ad6fc23ae 100644
--- a/chromium/cc/raster/raster_source.cc
+++ b/chromium/cc/raster/raster_source.cc
@@ -5,6 +5,7 @@
#include "cc/raster/raster_source.h"
#include <stddef.h>
+#include <algorithm>
#include "base/metrics/histogram_macros.h"
#include "base/trace_event/trace_event.h"
@@ -102,8 +103,10 @@ void RasterSource::PlaybackToCanvas(
// Treat all subnormal values as zero for performance.
ScopedSubnormalFloatDisabler disabler;
+ // NOTE: The following code should be kept consistent with
+ // PaintOpBufferSerializer::SerializePreamble().
bool is_partial_raster = canvas_bitmap_rect != canvas_playback_rect;
- if (!requires_clear_) {
+ if (!requires_clear_ && raster_transform.translation().IsZero()) {
// Clear opaque raster sources. Opaque rasters sources guarantee that all
// pixels inside the opaque region are painted. However, due to scaling
// it's possible that the last row and column might include pixels that
@@ -134,12 +137,13 @@ void RasterSource::PlaybackToCanvas(
raster_canvas->clear(SK_ColorTRANSPARENT);
}
- PlaybackToCanvas(raster_canvas, settings.image_provider);
+ PlaybackDisplayListToCanvas(raster_canvas, settings.image_provider);
raster_canvas->restore();
}
-void RasterSource::PlaybackToCanvas(SkCanvas* raster_canvas,
- ImageProvider* image_provider) const {
+void RasterSource::PlaybackDisplayListToCanvas(
+ SkCanvas* raster_canvas,
+ ImageProvider* image_provider) const {
// TODO(enne): Temporary CHECK debugging for http://crbug.com/823835
CHECK(display_list_.get());
int repeat_count = std::max(1, slow_down_raster_scale_factor_for_debug_);
diff --git a/chromium/cc/raster/raster_source.h b/chromium/cc/raster/raster_source.h
index 7a70742f127..8f7f8679691 100644
--- a/chromium/cc/raster/raster_source.h
+++ b/chromium/cc/raster/raster_source.h
@@ -56,6 +56,9 @@ class CC_EXPORT RasterSource : public base::RefCountedThreadSafe<RasterSource> {
// i.e. contents in the rect will be cropped and translated onto the canvas.
// canvas_playback_rect can be used to replay only part of the recording in,
// the content space, so only a sub-rect of the tile gets rastered.
+ //
+ // Note that this should only be called after the image decode controller has
+ // been set, which happens during commit.
void PlaybackToCanvas(SkCanvas* canvas,
const gfx::Size& content_size,
const gfx::Rect& canvas_bitmap_rect,
@@ -63,17 +66,6 @@ class CC_EXPORT RasterSource : public base::RefCountedThreadSafe<RasterSource> {
const gfx::AxisTransform2d& raster_transform,
const PlaybackSettings& settings) const;
- // Raster this RasterSource into the given canvas. Canvas states such as
- // CTM and clip region will be respected. This function will replace pixels
- // in the clip region without blending.
- //
- // Virtual for testing.
- //
- // Note that this should only be called after the image decode controller has
- // been set, which happens during commit.
- virtual void PlaybackToCanvas(SkCanvas* canvas,
- ImageProvider* image_provider) const;
-
// Returns whether the given rect at given scale is of solid color in
// this raster source, as well as the solid color value.
bool PerformSolidColorAnalysis(gfx::Rect content_rect, SkColor* color) const;
@@ -139,6 +131,14 @@ class CC_EXPORT RasterSource : public base::RefCountedThreadSafe<RasterSource> {
const gfx::Rect& canvas_bitmap_rect,
const gfx::Rect& canvas_playback_rect) const;
+ // Raster the display list of this raster source into the given canvas.
+ // Canvas states such as CTM and clip region will be respected.
+ // This function will replace pixels in the clip region without blending.
+ //
+ // Virtual for testing.
+ virtual void PlaybackDisplayListToCanvas(SkCanvas* canvas,
+ ImageProvider* image_provider) const;
+
// The serialized size for the largest op in this RasterSource. This is
// accessed only on the raster threads with the context lock acquired.
size_t max_op_size_hint_ =
diff --git a/chromium/cc/raster/scoped_gpu_raster.h b/chromium/cc/raster/scoped_gpu_raster.h
index 0ccd91c0259..3d454490bd7 100644
--- a/chromium/cc/raster/scoped_gpu_raster.h
+++ b/chromium/cc/raster/scoped_gpu_raster.h
@@ -7,7 +7,6 @@
#include <memory>
-#include "base/logging.h"
#include "cc/cc_export.h"
namespace viz {
diff --git a/chromium/cc/raster/staging_buffer_pool.cc b/chromium/cc/raster/staging_buffer_pool.cc
index fcbe0072eee..556a53615c7 100644
--- a/chromium/cc/raster/staging_buffer_pool.cc
+++ b/chromium/cc/raster/staging_buffer_pool.cc
@@ -133,9 +133,9 @@ StagingBufferPool::StagingBufferPool(
base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
this, "cc::StagingBufferPool", base::ThreadTaskRunnerHandle::Get());
- memory_pressure_listener_.reset(new base::MemoryPressureListener(
- base::BindRepeating(&StagingBufferPool::OnMemoryPressure,
- weak_ptr_factory_.GetWeakPtr())));
+ memory_pressure_listener_ = std::make_unique<base::MemoryPressureListener>(
+ FROM_HERE, base::BindRepeating(&StagingBufferPool::OnMemoryPressure,
+ weak_ptr_factory_.GetWeakPtr()));
reduce_memory_usage_callback_ = base::BindRepeating(
&StagingBufferPool::ReduceMemoryUsage, weak_ptr_factory_.GetWeakPtr());
diff --git a/chromium/cc/raster/task_graph_runner.h b/chromium/cc/raster/task_graph_runner.h
index 50c952bf60c..8a43daab03a 100644
--- a/chromium/cc/raster/task_graph_runner.h
+++ b/chromium/cc/raster/task_graph_runner.h
@@ -13,7 +13,6 @@
#include <memory>
#include <vector>
-#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "cc/cc_export.h"
#include "cc/raster/task.h"