1// Copyright 2011 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#ifndef CC_QUADS_RENDER_PASS_DRAW_QUAD_H_ 6#define CC_QUADS_RENDER_PASS_DRAW_QUAD_H_ 7 8#include "base/basictypes.h" 9#include "base/memory/scoped_ptr.h" 10#include "cc/base/cc_export.h" 11#include "cc/output/filter_operations.h" 12#include "cc/quads/draw_quad.h" 13#include "cc/quads/render_pass.h" 14#include "cc/resources/resource_provider.h" 15 16namespace cc { 17 18class CC_EXPORT RenderPassDrawQuad : public DrawQuad { 19 public: 20 static scoped_ptr<RenderPassDrawQuad> Create(); 21 virtual ~RenderPassDrawQuad(); 22 23 void SetNew(const SharedQuadState* shared_quad_state, 24 const gfx::Rect& rect, 25 const gfx::Rect& visible_rect, 26 RenderPass::Id render_pass_id, 27 bool is_replica, 28 ResourceProvider::ResourceId mask_resource_id, 29 const gfx::Rect& contents_changed_since_last_frame, 30 const gfx::RectF& mask_uv_rect, 31 const FilterOperations& filters, 32 const FilterOperations& background_filters); 33 34 void SetAll(const SharedQuadState* shared_quad_state, 35 const gfx::Rect& rect, 36 const gfx::Rect& opaque_rect, 37 const gfx::Rect& visible_rect, 38 bool needs_blending, 39 RenderPass::Id render_pass_id, 40 bool is_replica, 41 ResourceProvider::ResourceId mask_resource_id, 42 const gfx::Rect& contents_changed_since_last_frame, 43 const gfx::RectF& mask_uv_rect, 44 const FilterOperations& filters, 45 const FilterOperations& background_filters); 46 47 scoped_ptr<RenderPassDrawQuad> Copy( 48 const SharedQuadState* copied_shared_quad_state, 49 RenderPass::Id copied_render_pass_id) const; 50 51 RenderPass::Id render_pass_id; 52 bool is_replica; 53 ResourceProvider::ResourceId mask_resource_id; 54 gfx::Rect contents_changed_since_last_frame; 55 gfx::RectF mask_uv_rect; 56 57 // Post-processing filters, applied to the pixels in the render pass' texture. 58 FilterOperations filters; 59 60 // Post-processing filters, applied to the pixels showing through the 61 // background of the render pass, from behind it. 62 FilterOperations background_filters; 63 64 virtual void IterateResources(const ResourceIteratorCallback& callback) 65 OVERRIDE; 66 67 static const RenderPassDrawQuad* MaterialCast(const DrawQuad*); 68 69 private: 70 RenderPassDrawQuad(); 71 virtual void ExtendValue(base::DictionaryValue* value) const OVERRIDE; 72}; 73 74} // namespace cc 75 76#endif // CC_QUADS_RENDER_PASS_DRAW_QUAD_H_ 77