| 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_DIRECT_RENDERER_H_ | 5 #ifndef CC_DIRECT_RENDERER_H_ |
| 6 #define CC_DIRECT_RENDERER_H_ | 6 #define CC_DIRECT_RENDERER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "cc/cc_export.h" | 9 #include "cc/cc_export.h" |
| 10 #include "cc/renderer.h" | 10 #include "cc/renderer.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 class CC_EXPORT DirectRenderer : public Renderer { | 21 class CC_EXPORT DirectRenderer : public Renderer { |
| 22 public: | 22 public: |
| 23 virtual ~DirectRenderer(); | 23 virtual ~DirectRenderer(); |
| 24 | 24 |
| 25 ResourceProvider* resourceProvider() const { return m_resourceProvider; } | 25 ResourceProvider* resourceProvider() const { return m_resourceProvider; } |
| 26 | 26 |
| 27 virtual void decideRenderPassAllocationsForFrame(const RenderPassList& rende
rPassesInDrawOrder) OVERRIDE; | 27 virtual void decideRenderPassAllocationsForFrame(const RenderPassList& rende
rPassesInDrawOrder) OVERRIDE; |
| 28 virtual bool haveCachedResourcesForRenderPassId(RenderPass::Id) const OVERRI
DE; | 28 virtual bool haveCachedResourcesForRenderPassId(RenderPass::Id) const OVERRI
DE; |
| 29 virtual void drawFrame(const RenderPassList& renderPassesInDrawOrder, const
RenderPassIdHashMap& renderPassesById) OVERRIDE; | 29 virtual void drawFrame(const RenderPassList& renderPassesInDrawOrder, const
RenderPassIdHashMap& renderPassesById) OVERRIDE; |
| 30 | 30 |
| 31 protected: | 31 struct CC_EXPORT DrawingFrame { |
| 32 DirectRenderer(RendererClient* client, ResourceProvider* resourceProvider); | |
| 33 | |
| 34 struct DrawingFrame { | |
| 35 DrawingFrame(); | 32 DrawingFrame(); |
| 36 ~DrawingFrame(); | 33 ~DrawingFrame(); |
| 37 | 34 |
| 38 const RenderPassIdHashMap* renderPassesById; | 35 const RenderPassIdHashMap* renderPassesById; |
| 39 const RenderPass* rootRenderPass; | 36 const RenderPass* rootRenderPass; |
| 40 const RenderPass* currentRenderPass; | 37 const RenderPass* currentRenderPass; |
| 41 const ScopedResource* currentTexture; | 38 const ScopedResource* currentTexture; |
| 42 | 39 |
| 43 gfx::RectF rootDamageRect; | 40 gfx::RectF rootDamageRect; |
| 44 | 41 |
| 45 WebKit::WebTransformationMatrix projectionMatrix; | 42 WebKit::WebTransformationMatrix projectionMatrix; |
| 46 WebKit::WebTransformationMatrix windowMatrix; | 43 WebKit::WebTransformationMatrix windowMatrix; |
| 47 bool flippedY; | 44 bool flippedY; |
| 48 gfx::RectF scissorRectInRenderPassSpace; | 45 gfx::RectF scissorRectInRenderPassSpace; |
| 49 }; | 46 }; |
| 50 | 47 |
| 48 protected: |
| 49 DirectRenderer(RendererClient* client, ResourceProvider* resourceProvider); |
| 50 |
| 51 class CachedResource : public ScopedResource { | 51 class CachedResource : public ScopedResource { |
| 52 public: | 52 public: |
| 53 static scoped_ptr<CachedResource> create(ResourceProvider* resourceProvi
der) { | 53 static scoped_ptr<CachedResource> create(ResourceProvider* resourceProvi
der) { |
| 54 return make_scoped_ptr(new CachedResource(resourceProvider)); | 54 return make_scoped_ptr(new CachedResource(resourceProvider)); |
| 55 } | 55 } |
| 56 virtual ~CachedResource() {} | 56 virtual ~CachedResource() {} |
| 57 | 57 |
| 58 bool isComplete() const { return m_isComplete; } | 58 bool isComplete() const { return m_isComplete; } |
| 59 void setIsComplete(bool isComplete) { m_isComplete = isComplete; } | 59 void setIsComplete(bool isComplete) { m_isComplete = isComplete; } |
| 60 | 60 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 ScopedPtrHashMap<RenderPass::Id, CachedResource> m_renderPassTextures; | 96 ScopedPtrHashMap<RenderPass::Id, CachedResource> m_renderPassTextures; |
| 97 ResourceProvider* m_resourceProvider; | 97 ResourceProvider* m_resourceProvider; |
| 98 | 98 |
| 99 private: | 99 private: |
| 100 DISALLOW_COPY_AND_ASSIGN(DirectRenderer); | 100 DISALLOW_COPY_AND_ASSIGN(DirectRenderer); |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 } // namespace cc | 103 } // namespace cc |
| 104 | 104 |
| 105 #endif // CC_DIRECT_RENDERER_H_ | 105 #endif // CC_DIRECT_RENDERER_H_ |
| OLD | NEW |