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

Unified Diff: cc/output/direct_renderer.cc

Issue 2399983003: cc: Make OutputSurface::Reshape abstract (Closed)
Patch Set: reshapeabstract: . Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/output/direct_renderer.h ('k') | cc/output/gl_renderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/direct_renderer.cc
diff --git a/cc/output/direct_renderer.cc b/cc/output/direct_renderer.cc
index 4eb13ec146f8e7817045366787d14c29bfc8e421..cc7fd12c67002cf9dd367ff183eebf9d9792a2d6 100644
--- a/cc/output/direct_renderer.cc
+++ b/cc/output/direct_renderer.cc
@@ -233,14 +233,24 @@ void DirectRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order,
frame.root_damage_rect.Union(overlay_processor_->GetAndResetOverlayDamage());
frame.root_damage_rect.Intersect(gfx::Rect(device_viewport_size));
frame.device_viewport_size = device_viewport_size;
+ frame.device_color_space = device_color_space;
// Only reshape when we know we are going to draw. Otherwise, the reshape
// can leave the window at the wrong size if we never draw and the proper
// viewport size is never set.
- output_surface_->Reshape(device_viewport_size, device_scale_factor,
- device_color_space,
- frame.root_render_pass->has_transparent_background);
- surface_size_for_swap_buffers_ = device_viewport_size;
+ bool frame_has_alpha = frame.root_render_pass->has_transparent_background;
+ if (device_viewport_size != reshape_surface_size_ ||
+ device_scale_factor != reshape_device_scale_factor_ ||
+ device_color_space != reshape_device_color_space_ ||
+ frame_has_alpha != reshape_has_alpha_) {
+ reshape_surface_size_ = device_viewport_size;
+ reshape_device_scale_factor_ = device_scale_factor;
+ reshape_device_color_space_ = device_color_space;
+ reshape_has_alpha_ = frame.root_render_pass->has_transparent_background;
+ output_surface_->Reshape(reshape_surface_size_,
+ reshape_device_scale_factor_,
+ reshape_device_color_space_, reshape_has_alpha_);
+ }
BeginDrawingFrame(&frame);
@@ -542,10 +552,9 @@ bool DirectRenderer::UseRenderPass(DrawingFrame* frame,
size.Enlarge(enlarge_pass_texture_amount_.width(),
enlarge_pass_texture_amount_.height());
if (!texture->id()) {
- texture->Allocate(size,
- ResourceProvider::TEXTURE_HINT_IMMUTABLE_FRAMEBUFFER,
- resource_provider_->best_texture_format(),
- output_surface_->device_color_space());
+ texture->Allocate(
+ size, ResourceProvider::TEXTURE_HINT_IMMUTABLE_FRAMEBUFFER,
+ resource_provider_->best_texture_format(), frame->device_color_space);
}
DCHECK(texture->id());
« 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