Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: cc/output/direct_renderer.cc

Issue 2254543003: cc: Delete the RendererClient class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@setvisible-browser
Patch Set: deleterendererclient: rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/output/direct_renderer.h ('k') | cc/output/gl_renderer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "cc/output/direct_renderer.h" 5 #include "cc/output/direct_renderer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <unordered_map> 9 #include <unordered_map>
10 #include <utility> 10 #include <utility>
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 const DrawingFrame* frame, 121 const DrawingFrame* frame,
122 const gfx::Rect& draw_rect) const { 122 const gfx::Rect& draw_rect) const {
123 gfx::Rect window_rect = draw_rect; 123 gfx::Rect window_rect = draw_rect;
124 window_rect -= current_draw_rect_.OffsetFromOrigin(); 124 window_rect -= current_draw_rect_.OffsetFromOrigin();
125 window_rect += current_viewport_rect_.OffsetFromOrigin(); 125 window_rect += current_viewport_rect_.OffsetFromOrigin();
126 if (FlippedFramebuffer(frame)) 126 if (FlippedFramebuffer(frame))
127 window_rect.set_y(current_surface_size_.height() - window_rect.bottom()); 127 window_rect.set_y(current_surface_size_.height() - window_rect.bottom());
128 return window_rect; 128 return window_rect;
129 } 129 }
130 130
131 DirectRenderer::DirectRenderer(RendererClient* client, 131 DirectRenderer::DirectRenderer(const RendererSettings* settings,
132 const RendererSettings* settings,
133 OutputSurface* output_surface, 132 OutputSurface* output_surface,
134 ResourceProvider* resource_provider) 133 ResourceProvider* resource_provider)
135 : Renderer(client, settings), 134 : Renderer(settings),
136 output_surface_(output_surface), 135 output_surface_(output_surface),
137 resource_provider_(resource_provider), 136 resource_provider_(resource_provider),
138 overlay_processor_(new OverlayProcessor(output_surface)) { 137 overlay_processor_(new OverlayProcessor(output_surface)) {
139 overlay_processor_->Initialize(); 138 overlay_processor_->Initialize();
140 } 139 }
141 140
142 DirectRenderer::~DirectRenderer() {} 141 DirectRenderer::~DirectRenderer() {}
143 142
144 const TileDrawQuad* DirectRenderer::CanPassBeDrawnDirectly( 143 const TileDrawQuad* DirectRenderer::CanPassBeDrawnDirectly(
145 const RenderPass* pass) { 144 const RenderPass* pass) {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 211
213 DrawingFrame frame; 212 DrawingFrame frame;
214 frame.render_passes_in_draw_order = render_passes_in_draw_order; 213 frame.render_passes_in_draw_order = render_passes_in_draw_order;
215 frame.root_render_pass = root_render_pass; 214 frame.root_render_pass = root_render_pass;
216 frame.root_damage_rect = root_render_pass->damage_rect; 215 frame.root_damage_rect = root_render_pass->damage_rect;
217 frame.root_damage_rect.Union(overlay_processor_->GetAndResetOverlayDamage()); 216 frame.root_damage_rect.Union(overlay_processor_->GetAndResetOverlayDamage());
218 frame.root_damage_rect.Intersect(gfx::Rect(device_viewport_rect.size())); 217 frame.root_damage_rect.Intersect(gfx::Rect(device_viewport_rect.size()));
219 frame.device_viewport_rect = device_viewport_rect; 218 frame.device_viewport_rect = device_viewport_rect;
220 frame.device_clip_rect = device_clip_rect; 219 frame.device_clip_rect = device_clip_rect;
221 220
222 EnsureBackbuffer();
223
224 // Only reshape when we know we are going to draw. Otherwise, the reshape 221 // Only reshape when we know we are going to draw. Otherwise, the reshape
225 // can leave the window at the wrong size if we never draw and the proper 222 // can leave the window at the wrong size if we never draw and the proper
226 // viewport size is never set. 223 // viewport size is never set.
227 output_surface_->Reshape(device_viewport_rect.size(), device_scale_factor, 224 output_surface_->Reshape(device_viewport_rect.size(), device_scale_factor,
228 device_color_space, 225 device_color_space,
229 frame.root_render_pass->has_transparent_background); 226 frame.root_render_pass->has_transparent_background);
230 227
231 BeginDrawingFrame(&frame); 228 BeginDrawingFrame(&frame);
232 229
233 // Draw all non-root render passes except for the root render pass. 230 // Draw all non-root render passes except for the root render pass.
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 auto iter = render_pass_textures_.find(id); 569 auto iter = render_pass_textures_.find(id);
573 return iter != render_pass_textures_.end() && iter->second->id(); 570 return iter != render_pass_textures_.end() && iter->second->id();
574 } 571 }
575 572
576 // static 573 // static
577 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { 574 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) {
578 return render_pass->output_rect.size(); 575 return render_pass->output_rect.size();
579 } 576 }
580 577
581 } // namespace cc 578 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/direct_renderer.h ('k') | cc/output/gl_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698