Fix mouse warp with 2x displays
[chromium-blink-merge.git] / gpu / skia_runner / sk_picture_rasterizer.h
blob380bfa0de06a6394355c23ce33ba15368962d4e4
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.
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"
11 namespace skia_runner {
13 class SkPictureRasterizer {
14 public:
15 SkPictureRasterizer(skia::RefPtr<GrContext> gr_context, int max_texture_size);
16 ~SkPictureRasterizer();
18 skia::RefPtr<SkImage> Rasterize(const SkPicture* picture) const;
20 void set_msaa_sample_count(int msaa_sample_count) {
21 msaa_sample_count_ = msaa_sample_count;
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;
28 private:
29 skia::RefPtr<SkImage> RasterizeTile(const SkPicture* picture,
30 const SkRect& rect) const;
32 bool use_lcd_text_;
33 bool use_distance_field_text_;
34 int msaa_sample_count_;
36 int max_texture_size_;
37 skia::RefPtr<GrContext> gr_context_;
40 } // namespace skia_runner