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

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

Issue 21159007: cc: Adding support for RGBA_4444 tile textures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: deprecate GLenum format throughout cc 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
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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 return false; 391 return false;
392 392
393 CachedResource* texture = render_pass_textures_.get(render_pass->id); 393 CachedResource* texture = render_pass_textures_.get(render_pass->id);
394 DCHECK(texture); 394 DCHECK(texture);
395 395
396 gfx::Size size = RenderPassTextureSize(render_pass); 396 gfx::Size size = RenderPassTextureSize(render_pass);
397 size.Enlarge(enlarge_pass_texture_amount_.x(), 397 size.Enlarge(enlarge_pass_texture_amount_.x(),
398 enlarge_pass_texture_amount_.y()); 398 enlarge_pass_texture_amount_.y());
399 if (!texture->id() && 399 if (!texture->id() &&
400 !texture->Allocate(size, 400 !texture->Allocate(size,
401 RenderPassTextureFormat(render_pass), 401 ResourceProvider::TextureUsageFramebuffer,
402 ResourceProvider::TextureUsageFramebuffer)) 402 RenderPassTextureFormat(render_pass)))
403 return false; 403 return false;
404 404
405 return BindFramebufferToTexture(frame, texture, render_pass->output_rect); 405 return BindFramebufferToTexture(frame, texture, render_pass->output_rect);
406 } 406 }
407 407
408 bool DirectRenderer::HaveCachedResourcesForRenderPassId(RenderPass::Id id) 408 bool DirectRenderer::HaveCachedResourcesForRenderPassId(RenderPass::Id id)
409 const { 409 const {
410 if (!settings_->cache_render_pass_contents) 410 if (!settings_->cache_render_pass_contents)
411 return false; 411 return false;
412 412
413 CachedResource* texture = render_pass_textures_.get(id); 413 CachedResource* texture = render_pass_textures_.get(id);
414 return texture && texture->id() && texture->is_complete(); 414 return texture && texture->id() && texture->is_complete();
415 } 415 }
416 416
417 // static 417 // static
418 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { 418 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) {
419 return render_pass->output_rect.size(); 419 return render_pass->output_rect.size();
420 } 420 }
421 421
422 // static 422 // static
423 GLenum DirectRenderer::RenderPassTextureFormat(const RenderPass* render_pass) { 423 ResourceProvider::TextureFormat DirectRenderer::RenderPassTextureFormat(
424 return GL_RGBA; 424 const RenderPass* render_pass) {
425 return ResourceProvider::RGBA_8888;
425 } 426 }
426 427
427 } // namespace cc 428 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698