Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(450)

Unified Diff: cc/raster/gpu_raster_buffer_provider.h

Issue 1951193002: cc: Add mailbox support to ResourceProvider write locks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@worker_context_stream
Patch Set: vmpstr's review Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/raster/bitmap_raster_buffer_provider.cc ('k') | cc/raster/gpu_raster_buffer_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/raster/gpu_raster_buffer_provider.h
diff --git a/cc/raster/gpu_raster_buffer_provider.h b/cc/raster/gpu_raster_buffer_provider.h
index b6aea8341a2cef3b899a5e3cac373b79133a71b0..305a2d809838cf3b515b1c3d71ba5b4a7e983bf0 100644
--- a/cc/raster/gpu_raster_buffer_provider.h
+++ b/cc/raster/gpu_raster_buffer_provider.h
@@ -9,11 +9,11 @@
#include "base/macros.h"
#include "cc/raster/raster_buffer_provider.h"
+#include "cc/resources/resource_provider.h"
+#include "gpu/command_buffer/common/sync_token.h"
namespace cc {
class ContextProvider;
-class GpuRasterizer;
-class ResourceProvider;
class CC_EXPORT GpuRasterBufferProvider : public RasterBufferProvider {
public:
@@ -21,7 +21,8 @@ class CC_EXPORT GpuRasterBufferProvider : public RasterBufferProvider {
ContextProvider* worker_context_provider,
ResourceProvider* resource_provider,
bool use_distance_field_text,
- int gpu_rasterization_msaa_sample_count);
+ int gpu_rasterization_msaa_sample_count,
+ bool async_worker_context_enabled);
~GpuRasterBufferProvider() override;
// Overridden from RasterBufferProvider:
@@ -30,14 +31,63 @@ class CC_EXPORT GpuRasterBufferProvider : public RasterBufferProvider {
uint64_t resource_content_id,
uint64_t previous_content_id) override;
void ReleaseBufferForRaster(std::unique_ptr<RasterBuffer> buffer) override;
- void OrderingBarrier() override;
+ bool OrderingBarrier() override;
ResourceFormat GetResourceFormat(bool must_support_alpha) const override;
bool GetResourceRequiresSwizzle(bool must_support_alpha) const override;
void Shutdown() override;
+ void PlaybackOnWorkerThread(
+ ResourceProvider::ScopedWriteLockGL* resource_lock,
+ const gpu::SyncToken& sync_token,
+ bool resource_has_previous_content,
+ const RasterSource* raster_source,
+ const gfx::Rect& raster_full_rect,
+ const gfx::Rect& raster_dirty_rect,
+ uint64_t new_content_id,
+ float scale,
+ const RasterSource::PlaybackSettings& playback_settings);
+
private:
+ class RasterBufferImpl : public RasterBuffer {
+ public:
+ RasterBufferImpl(GpuRasterBufferProvider* client,
+ ResourceProvider* resource_provider,
+ ResourceId resource_id,
+ bool async_worker_context_enabled,
+ bool resource_has_previous_content);
+ ~RasterBufferImpl() override;
+
+ // Overridden from RasterBuffer:
+ void Playback(
+ const RasterSource* raster_source,
+ const gfx::Rect& raster_full_rect,
+ const gfx::Rect& raster_dirty_rect,
+ uint64_t new_content_id,
+ float scale,
+ const RasterSource::PlaybackSettings& playback_settings) override;
+
+ void set_sync_token(const gpu::SyncToken& sync_token) {
+ sync_token_ = sync_token;
+ }
+
+ private:
+ GpuRasterBufferProvider* const client_;
+ ResourceProvider::ScopedWriteLockGL lock_;
+ const bool resource_has_previous_content_;
+
+ gpu::SyncToken sync_token_;
+
+ DISALLOW_COPY_AND_ASSIGN(RasterBufferImpl);
+ };
+
ContextProvider* const compositor_context_provider_;
- std::unique_ptr<GpuRasterizer> rasterizer_;
+ ContextProvider* const worker_context_provider_;
+ ResourceProvider* const resource_provider_;
+ const bool use_distance_field_text_;
+ const int msaa_sample_count_;
+ const bool async_worker_context_enabled_;
+
+ std::set<RasterBufferImpl*> pending_raster_buffers_;
DISALLOW_COPY_AND_ASSIGN(GpuRasterBufferProvider);
};
« no previous file with comments | « cc/raster/bitmap_raster_buffer_provider.cc ('k') | cc/raster/gpu_raster_buffer_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698