| 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_RASTER_GPU_RASTERIZER_H_ | 5 #ifndef CC_RASTER_GPU_RASTERIZER_H_ |
| 6 #define CC_RASTER_GPU_RASTERIZER_H_ | 6 #define CC_RASTER_GPU_RASTERIZER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "cc/base/cc_export.h" | 11 #include "cc/base/cc_export.h" |
| 12 #include "cc/playback/raster_source.h" | 12 #include "cc/playback/raster_source.h" |
| 13 #include "cc/resources/resource_pool.h" | 13 #include "cc/resources/resource_pool.h" |
| 14 #include "cc/tiles/tile.h" | 14 #include "cc/tiles/tile.h" |
| 15 #include "third_party/skia/include/core/SkMultiPictureDraw.h" | 15 #include "third_party/skia/include/core/SkSurface.h" |
| 16 | 16 |
| 17 namespace cc { | 17 namespace cc { |
| 18 | 18 |
| 19 class ContextProvider; | 19 class ContextProvider; |
| 20 class RasterSource; | 20 class RasterSource; |
| 21 class ResourceProvider; | 21 class ResourceProvider; |
| 22 class ScopedGpuRaster; |
| 22 | 23 |
| 23 class CC_EXPORT GpuRasterizer { | 24 class CC_EXPORT GpuRasterizer { |
| 24 public: | 25 public: |
| 25 ~GpuRasterizer(); | 26 ~GpuRasterizer(); |
| 26 | 27 |
| 27 void RasterizeSource(ResourceProvider::ScopedWriteLockGr* write_lock, | 28 void RasterizeSource(ResourceProvider::ScopedWriteLockGr* write_lock, |
| 28 const RasterSource* raster_source, | 29 const RasterSource* raster_source, |
| 29 const gfx::Rect& raster_full_rect, | 30 const gfx::Rect& raster_full_rect, |
| 30 const gfx::Rect& playback_rect, | 31 const gfx::Rect& playback_rect, |
| 31 float scale, | 32 float scale, |
| 32 const RasterSource::PlaybackSettings& playback_settings); | 33 const RasterSource::PlaybackSettings& playback_settings); |
| 33 | 34 |
| 34 ResourceProvider* resource_provider() const { return resource_provider_; } | 35 ResourceProvider* resource_provider() const { return resource_provider_; } |
| 35 ContextProvider* worker_context_provider() const { | 36 ContextProvider* worker_context_provider() const { |
| 36 return worker_context_provider_; | 37 return worker_context_provider_; |
| 37 } | 38 } |
| 38 | 39 |
| 39 private: | 40 private: |
| 40 GpuRasterizer(ContextProvider* worker_context_provider, | 41 GpuRasterizer(ContextProvider* worker_context_provider, |
| 41 ResourceProvider* resource_provider, | 42 ResourceProvider* resource_provider, |
| 42 bool use_distance_filed_text, | 43 bool use_distance_filed_text, |
| 43 int msaa_sample_count); | 44 int msaa_sample_count); |
| 45 SkSurface* AcquireSurface(const ScopedGpuRaster&, |
| 46 ResourceProvider::ScopedWriteLockGr*, |
| 47 bool use_device_independent_fonts, |
| 48 bool can_use_lcd_text); |
| 49 void ReleaseSurface(const ScopedGpuRaster&, |
| 50 ResourceProvider::ScopedWriteLockGr*); |
| 51 void AllocateMSAASurfaceIfNeeded(const SkImageInfo&, |
| 52 bool use_device_independent_fonts, |
| 53 bool can_use_lcd_text); |
| 44 | 54 |
| 45 ContextProvider* worker_context_provider_; | 55 ContextProvider* worker_context_provider_; |
| 46 ResourceProvider* resource_provider_; | 56 ResourceProvider* resource_provider_; |
| 47 | 57 |
| 48 bool use_distance_field_text_; | 58 bool use_device_independent_fonts_; |
| 49 int msaa_sample_count_; | 59 int msaa_sample_count_; |
| 50 | 60 |
| 61 sk_sp<SkSurface> msaa_surface_; |
| 62 SkImageInfo msaa_surface_image_info_; |
| 63 bool msaa_surface_use_device_independent_fonts_; |
| 64 bool msaa_surface_can_use_lcd_text_; |
| 65 |
| 51 friend class GpuRasterBufferProvider; | 66 friend class GpuRasterBufferProvider; |
| 67 friend class GpuTileTaskWorkerPool; |
| 68 |
| 52 DISALLOW_COPY_AND_ASSIGN(GpuRasterizer); | 69 DISALLOW_COPY_AND_ASSIGN(GpuRasterizer); |
| 53 }; | 70 }; |
| 54 | 71 |
| 55 } // namespace cc | 72 } // namespace cc |
| 56 | 73 |
| 57 #endif // CC_RASTER_GPU_RASTERIZER_H_ | 74 #endif // CC_RASTER_GPU_RASTERIZER_H_ |
| OLD | NEW |