| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_OUTPUT_SOFTWARE_RENDERER_H_ | 5 #ifndef CC_OUTPUT_SOFTWARE_RENDERER_H_ |
| 6 #define CC_OUTPUT_SOFTWARE_RENDERER_H_ | 6 #define CC_OUTPUT_SOFTWARE_RENDERER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
| 10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
| 11 #include "cc/output/direct_renderer.h" | 11 #include "cc/output/direct_renderer.h" |
| 12 #include "cc/output/renderer_capabilities_impl.h" | |
| 13 | 12 |
| 14 namespace cc { | 13 namespace cc { |
| 15 class DebugBorderDrawQuad; | 14 class DebugBorderDrawQuad; |
| 16 class OutputSurface; | 15 class OutputSurface; |
| 17 class PictureDrawQuad; | 16 class PictureDrawQuad; |
| 18 class RenderPassDrawQuad; | 17 class RenderPassDrawQuad; |
| 19 class ResourceProvider; | 18 class ResourceProvider; |
| 20 class SoftwareOutputDevice; | 19 class SoftwareOutputDevice; |
| 21 class SolidColorDrawQuad; | 20 class SolidColorDrawQuad; |
| 22 class TextureDrawQuad; | 21 class TextureDrawQuad; |
| 23 class TileDrawQuad; | 22 class TileDrawQuad; |
| 24 | 23 |
| 25 class CC_EXPORT SoftwareRenderer : public DirectRenderer { | 24 class CC_EXPORT SoftwareRenderer : public DirectRenderer { |
| 26 public: | 25 public: |
| 27 SoftwareRenderer(const RendererSettings* settings, | 26 SoftwareRenderer(const RendererSettings* settings, |
| 28 OutputSurface* output_surface, | 27 OutputSurface* output_surface, |
| 29 ResourceProvider* resource_provider); | 28 ResourceProvider* resource_provider); |
| 30 | 29 |
| 31 ~SoftwareRenderer() override; | 30 ~SoftwareRenderer() override; |
| 32 | 31 |
| 33 const RendererCapabilitiesImpl& Capabilities() const override; | |
| 34 void SwapBuffers(CompositorFrameMetadata metadata) override; | 32 void SwapBuffers(CompositorFrameMetadata metadata) override; |
| 35 | 33 |
| 36 void SetDisablePictureQuadImageFiltering(bool disable) { | 34 void SetDisablePictureQuadImageFiltering(bool disable) { |
| 37 disable_picture_quad_image_filtering_ = disable; | 35 disable_picture_quad_image_filtering_ = disable; |
| 38 } | 36 } |
| 39 | 37 |
| 40 protected: | 38 protected: |
| 41 bool CanPartialSwap() override; | 39 bool CanPartialSwap() override; |
| 42 void BindFramebufferToOutputSurface(DrawingFrame* frame) override; | 40 void BindFramebufferToOutputSurface(DrawingFrame* frame) override; |
| 43 bool BindFramebufferToTexture(DrawingFrame* frame, | 41 bool BindFramebufferToTexture(DrawingFrame* frame, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 const RenderPassDrawQuad* quad, | 87 const RenderPassDrawQuad* quad, |
| 90 const gfx::Transform& contents_device_transform) const; | 88 const gfx::Transform& contents_device_transform) const; |
| 91 SkBitmap GetBackdropBitmap(const gfx::Rect& bounding_rect) const; | 89 SkBitmap GetBackdropBitmap(const gfx::Rect& bounding_rect) const; |
| 92 sk_sp<SkShader> GetBackgroundFilterShader( | 90 sk_sp<SkShader> GetBackgroundFilterShader( |
| 93 const DrawingFrame* frame, | 91 const DrawingFrame* frame, |
| 94 const RenderPassDrawQuad* quad, | 92 const RenderPassDrawQuad* quad, |
| 95 SkShader::TileMode content_tile_mode) const; | 93 SkShader::TileMode content_tile_mode) const; |
| 96 | 94 |
| 97 bool disable_picture_quad_image_filtering_ = false; | 95 bool disable_picture_quad_image_filtering_ = false; |
| 98 | 96 |
| 99 RendererCapabilitiesImpl capabilities_; | |
| 100 bool is_scissor_enabled_ = false; | 97 bool is_scissor_enabled_ = false; |
| 101 gfx::Rect scissor_rect_; | 98 gfx::Rect scissor_rect_; |
| 102 | 99 |
| 103 SoftwareOutputDevice* output_device_; | 100 SoftwareOutputDevice* output_device_; |
| 104 SkCanvas* root_canvas_ = nullptr; | 101 SkCanvas* root_canvas_ = nullptr; |
| 105 SkCanvas* current_canvas_ = nullptr; | 102 SkCanvas* current_canvas_ = nullptr; |
| 106 SkPaint current_paint_; | 103 SkPaint current_paint_; |
| 107 std::unique_ptr<ResourceProvider::ScopedWriteLockSoftware> | 104 std::unique_ptr<ResourceProvider::ScopedWriteLockSoftware> |
| 108 current_framebuffer_lock_; | 105 current_framebuffer_lock_; |
| 109 sk_sp<SkCanvas> current_framebuffer_canvas_; | 106 sk_sp<SkCanvas> current_framebuffer_canvas_; |
| 110 | 107 |
| 111 DISALLOW_COPY_AND_ASSIGN(SoftwareRenderer); | 108 DISALLOW_COPY_AND_ASSIGN(SoftwareRenderer); |
| 112 }; | 109 }; |
| 113 | 110 |
| 114 } // namespace cc | 111 } // namespace cc |
| 115 | 112 |
| 116 #endif // CC_OUTPUT_SOFTWARE_RENDERER_H_ | 113 #endif // CC_OUTPUT_SOFTWARE_RENDERER_H_ |
| OLD | NEW |