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