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

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

Issue 23503003: cc: Add readback and forced draw states to the Scheduler (Closed) Base URL: http://git.chromium.org/chromium/src.git@schedReorg3
Patch Set: Fix mac_rel failure by returning false from CanReadback when context lost Created 7 years, 3 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 | « no previous file | cc/output/output_surface.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 <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 DirectRenderer::DirectRenderer(RendererClient* client, 129 DirectRenderer::DirectRenderer(RendererClient* client,
130 OutputSurface* output_surface, 130 OutputSurface* output_surface,
131 ResourceProvider* resource_provider) 131 ResourceProvider* resource_provider)
132 : Renderer(client), 132 : Renderer(client),
133 output_surface_(output_surface), 133 output_surface_(output_surface),
134 resource_provider_(resource_provider) {} 134 resource_provider_(resource_provider) {}
135 135
136 DirectRenderer::~DirectRenderer() {} 136 DirectRenderer::~DirectRenderer() {}
137 137
138 bool DirectRenderer::CanReadPixels() const { return true; } 138 bool DirectRenderer::CanReadPixels() const {
139 return !output_surface_->IsLost();
brianderson 2013/09/06 21:43:15 This hopefully fixes the mac_rel failure when losi
danakj 2013/09/06 21:45:57 This is kinda abuse of this method. It's really me
140 }
139 141
140 void DirectRenderer::SetEnlargePassTextureAmountForTesting( 142 void DirectRenderer::SetEnlargePassTextureAmountForTesting(
141 gfx::Vector2d amount) { 143 gfx::Vector2d amount) {
142 enlarge_pass_texture_amount_ = amount; 144 enlarge_pass_texture_amount_ = amount;
143 } 145 }
144 146
145 void DirectRenderer::DecideRenderPassAllocationsForFrame( 147 void DirectRenderer::DecideRenderPassAllocationsForFrame(
146 const RenderPassList& render_passes_in_draw_order) { 148 const RenderPassList& render_passes_in_draw_order) {
147 if (!resource_provider_) 149 if (!resource_provider_)
148 return; 150 return;
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { 415 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) {
414 return render_pass->output_rect.size(); 416 return render_pass->output_rect.size();
415 } 417 }
416 418
417 // static 419 // static
418 GLenum DirectRenderer::RenderPassTextureFormat(const RenderPass* render_pass) { 420 GLenum DirectRenderer::RenderPassTextureFormat(const RenderPass* render_pass) {
419 return GL_RGBA; 421 return GL_RGBA;
420 } 422 }
421 423
422 } // namespace cc 424 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/output/output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698