| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_RESOURCES_GPU_RASTERIZER_H_ | 5 #ifndef CC_RESOURCES_GPU_RASTERIZER_H_ |
| 6 #define CC_RESOURCES_GPU_RASTERIZER_H_ | 6 #define CC_RESOURCES_GPU_RASTERIZER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 class CC_EXPORT GpuRasterizer : public Rasterizer { | 21 class CC_EXPORT GpuRasterizer : public Rasterizer { |
| 22 public: | 22 public: |
| 23 ~GpuRasterizer() override; | 23 ~GpuRasterizer() override; |
| 24 | 24 |
| 25 static scoped_ptr<GpuRasterizer> Create( | 25 static scoped_ptr<GpuRasterizer> Create( |
| 26 ContextProvider* context_provider, | 26 ContextProvider* context_provider, |
| 27 ResourceProvider* resource_provider, | 27 ResourceProvider* resource_provider, |
| 28 bool use_distance_field_text, | 28 bool use_distance_field_text, |
| 29 bool threaded_gpu_rasterization_enabled, | 29 bool threaded_gpu_rasterization_enabled, |
| 30 int msaa_sample_count); | 30 int msaa_sample_count); |
| 31 |
| 32 // Overriden from Rasterizer. |
| 31 PrepareTilesMode GetPrepareTilesMode() override; | 33 PrepareTilesMode GetPrepareTilesMode() override; |
| 32 void RasterizeTiles( | 34 void RasterizeTiles( |
| 33 const TileVector& tiles, | 35 const TileVector& tiles, |
| 34 ResourcePool* resource_pool, | 36 ResourcePool* resource_pool, |
| 35 ResourceFormat resource_format, | 37 ResourceFormat resource_format, |
| 36 const UpdateTileDrawInfoCallback& update_tile_draw_info) override; | 38 const UpdateTileDrawInfoCallback& update_tile_draw_info) override; |
| 37 | 39 |
| 40 void RasterizeSource(bool use_worker_context, |
| 41 ResourceProvider::ScopedWriteLockGr* write_lock, |
| 42 const RasterSource* raster_source, |
| 43 const gfx::Rect& rect, |
| 44 float scale); |
| 45 |
| 46 ResourceProvider* resource_provider() { return resource_provider_; } |
| 47 |
| 38 private: | 48 private: |
| 39 GpuRasterizer(ContextProvider* context_provider, | 49 GpuRasterizer(ContextProvider* context_provider, |
| 40 ResourceProvider* resource_provider, | 50 ResourceProvider* resource_provider, |
| 41 bool use_distance_filed_text, | 51 bool use_distance_filed_text, |
| 42 bool threaded_gpu_rasterization_enabled, | 52 bool threaded_gpu_rasterization_enabled, |
| 43 int msaa_sample_count); | 53 int msaa_sample_count); |
| 44 | 54 |
| 45 using ScopedResourceWriteLocks = | 55 using ScopedResourceWriteLocks = |
| 46 ScopedPtrVector<ResourceProvider::ScopedWriteLockGr>; | 56 ScopedPtrVector<ResourceProvider::ScopedWriteLockGr>; |
| 47 | 57 |
| 58 ContextProvider* GetContextProvider(bool worker_context); |
| 48 void PerformSolidColorAnalysis(const Tile* tile, | 59 void PerformSolidColorAnalysis(const Tile* tile, |
| 49 RasterSource::SolidColorAnalysis* analysis); | 60 RasterSource::SolidColorAnalysis* analysis); |
| 50 void AddToMultiPictureDraw(const Tile* tile, | 61 void AddToMultiPictureDraw(const Tile* tile, |
| 51 const ScopedResource* resource, | 62 const ScopedResource* resource, |
| 52 ScopedResourceWriteLocks* locks); | 63 ScopedResourceWriteLocks* locks); |
| 53 | 64 |
| 54 ContextProvider* context_provider_; | |
| 55 ResourceProvider* resource_provider_; | 65 ResourceProvider* resource_provider_; |
| 56 SkMultiPictureDraw multi_picture_draw_; | 66 SkMultiPictureDraw multi_picture_draw_; |
| 57 | 67 |
| 58 bool use_distance_field_text_; | 68 bool use_distance_field_text_; |
| 59 bool threaded_gpu_rasterization_enabled_; | 69 bool threaded_gpu_rasterization_enabled_; |
| 60 int msaa_sample_count_; | 70 int msaa_sample_count_; |
| 61 | 71 |
| 62 DISALLOW_COPY_AND_ASSIGN(GpuRasterizer); | 72 DISALLOW_COPY_AND_ASSIGN(GpuRasterizer); |
| 63 }; | 73 }; |
| 64 | 74 |
| 65 } // namespace cc | 75 } // namespace cc |
| 66 | 76 |
| 67 #endif // CC_RESOURCES_GPU_RASTERIZER_H_ | 77 #endif // CC_RESOURCES_GPU_RASTERIZER_H_ |
| OLD | NEW |