OLD | NEW |
| (Empty) |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "base/memory/scoped_ptr.h" | |
6 #include "gpu/command_buffer/client/gl_in_process_context.h" | |
7 #include "skia/ext/refptr.h" | |
8 #include "third_party/skia/include/core/SkPicture.h" | |
9 #include "third_party/skia/include/gpu/GrContext.h" | |
10 | |
11 namespace skia_runner { | |
12 | |
13 class SkPictureRasterizer { | |
14 public: | |
15 SkPictureRasterizer(skia::RefPtr<GrContext> gr_context, int max_texture_size); | |
16 ~SkPictureRasterizer(); | |
17 | |
18 skia::RefPtr<SkImage> Rasterize(const SkPicture* picture) const; | |
19 | |
20 void set_msaa_sample_count(int msaa_sample_count) { | |
21 msaa_sample_count_ = msaa_sample_count; | |
22 } | |
23 void set_use_lcd_text(bool use_lcd_text) { use_lcd_text_ = use_lcd_text; } | |
24 void set_use_distance_field_text(bool use_distance_field_text) { | |
25 use_distance_field_text_ = use_distance_field_text; | |
26 } | |
27 | |
28 private: | |
29 skia::RefPtr<SkImage> RasterizeTile(const SkPicture* picture, | |
30 const SkRect& rect) const; | |
31 | |
32 bool use_lcd_text_; | |
33 bool use_distance_field_text_; | |
34 int msaa_sample_count_; | |
35 | |
36 int max_texture_size_; | |
37 skia::RefPtr<GrContext> gr_context_; | |
38 }; | |
39 | |
40 } // namespace skia_runner | |
OLD | NEW |