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

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

Issue 2235623003: cc: Add gfx::ColorSpace to cc::ResourceProvider resource creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/layers/texture_layer_impl.cc ('k') | cc/output/gl_renderer.cc » ('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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 545
546 ScopedResource* texture = render_pass_textures_[render_pass->id].get(); 546 ScopedResource* texture = render_pass_textures_[render_pass->id].get();
547 DCHECK(texture); 547 DCHECK(texture);
548 548
549 gfx::Size size = RenderPassTextureSize(render_pass); 549 gfx::Size size = RenderPassTextureSize(render_pass);
550 size.Enlarge(enlarge_pass_texture_amount_.width(), 550 size.Enlarge(enlarge_pass_texture_amount_.width(),
551 enlarge_pass_texture_amount_.height()); 551 enlarge_pass_texture_amount_.height());
552 if (!texture->id()) { 552 if (!texture->id()) {
553 texture->Allocate(size, 553 texture->Allocate(size,
554 ResourceProvider::TEXTURE_HINT_IMMUTABLE_FRAMEBUFFER, 554 ResourceProvider::TEXTURE_HINT_IMMUTABLE_FRAMEBUFFER,
555 resource_provider_->best_texture_format()); 555 resource_provider_->best_texture_format(),
556 output_surface_->device_color_space());
556 } 557 }
557 DCHECK(texture->id()); 558 DCHECK(texture->id());
558 559
559 if (BindFramebufferToTexture(frame, texture)) { 560 if (BindFramebufferToTexture(frame, texture)) {
560 InitializeViewport(frame, render_pass->output_rect, 561 InitializeViewport(frame, render_pass->output_rect,
561 gfx::Rect(render_pass->output_rect.size()), 562 gfx::Rect(render_pass->output_rect.size()),
562 texture->size()); 563 texture->size());
563 return true; 564 return true;
564 } 565 }
565 566
566 return false; 567 return false;
567 } 568 }
568 569
569 bool DirectRenderer::HasAllocatedResourcesForTesting(RenderPassId id) const { 570 bool DirectRenderer::HasAllocatedResourcesForTesting(RenderPassId id) const {
570 auto iter = render_pass_textures_.find(id); 571 auto iter = render_pass_textures_.find(id);
571 return iter != render_pass_textures_.end() && iter->second->id(); 572 return iter != render_pass_textures_.end() && iter->second->id();
572 } 573 }
573 574
574 // static 575 // static
575 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { 576 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) {
576 return render_pass->output_rect.size(); 577 return render_pass->output_rect.size();
577 } 578 }
578 579
579 } // namespace cc 580 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/texture_layer_impl.cc ('k') | cc/output/gl_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698