| 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() { return resource_provider_; } | 35 ResourceProvider* resource_provider() { return resource_provider_; } |
| 35 | 36 |
| 36 private: | 37 private: |
| 37 GpuRasterizer(ContextProvider* context_provider, | 38 GpuRasterizer(ContextProvider* context_provider, |
| 38 ResourceProvider* resource_provider, | 39 ResourceProvider* resource_provider, |
| 39 bool use_distance_filed_text, | 40 bool use_distance_filed_text, |
| 40 int msaa_sample_count); | 41 int msaa_sample_count); |
| 42 SkSurface* AcquireSurface(const ScopedGpuRaster&, |
| 43 ContextProvider*, |
| 44 ResourceProvider::ScopedWriteLockGr*, |
| 45 bool use_device_independent_fonts, |
| 46 bool can_use_lcd_text); |
| 47 void ReleaseSurface(const ScopedGpuRaster&, |
| 48 ResourceProvider::ScopedWriteLockGr*); |
| 49 void AllocateMSAASurfaceIfNeeded(const SkImageInfo&, |
| 50 bool use_device_independent_fonts, |
| 51 bool can_use_lcd_text); |
| 41 | 52 |
| 42 ResourceProvider* resource_provider_; | 53 ResourceProvider* resource_provider_; |
| 43 | 54 |
| 44 bool use_distance_field_text_; | 55 bool use_device_independent_fonts_; |
| 45 int msaa_sample_count_; | 56 int msaa_sample_count_; |
| 46 | 57 |
| 58 sk_sp<SkSurface> msaa_surface_; |
| 59 SkImageInfo msaa_surface_image_info_; |
| 60 bool msaa_surface_use_device_independent_fonts_; |
| 61 bool msaa_surface_can_use_lcd_text_; |
| 47 friend class GpuTileTaskWorkerPool; | 62 friend class GpuTileTaskWorkerPool; |
| 48 DISALLOW_COPY_AND_ASSIGN(GpuRasterizer); | 63 DISALLOW_COPY_AND_ASSIGN(GpuRasterizer); |
| 49 }; | 64 }; |
| 50 | 65 |
| 51 } // namespace cc | 66 } // namespace cc |
| 52 | 67 |
| 53 #endif // CC_RASTER_GPU_RASTERIZER_H_ | 68 #endif // CC_RASTER_GPU_RASTERIZER_H_ |
| OLD | NEW |