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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 21159007: cc: Adding support for RGBA_4444 tile textures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review feedback 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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after
1638 ContextProvider* context_provider, 1638 ContextProvider* context_provider,
1639 bool using_map_image) { 1639 bool using_map_image) {
1640 DCHECK(settings_.impl_side_painting); 1640 DCHECK(settings_.impl_side_painting);
1641 DCHECK(resource_provider); 1641 DCHECK(resource_provider);
1642 tile_manager_ = 1642 tile_manager_ =
1643 TileManager::Create(this, 1643 TileManager::Create(this,
1644 resource_provider, 1644 resource_provider,
1645 settings_.num_raster_threads, 1645 settings_.num_raster_threads,
1646 rendering_stats_instrumentation_, 1646 rendering_stats_instrumentation_,
1647 using_map_image, 1647 using_map_image,
1648 GetMaxTransferBufferUsageBytes(context_provider)); 1648 GetMaxTransferBufferUsageBytes(context_provider),
1649 settings_.use_rgba_4444_textures);
1649 1650
1650 UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy()); 1651 UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy());
1651 need_to_update_visible_tiles_before_draw_ = false; 1652 need_to_update_visible_tiles_before_draw_ = false;
1652 } 1653 }
1653 1654
1654 void LayerTreeHostImpl::EnforceZeroBudget(bool zero_budget) { 1655 void LayerTreeHostImpl::EnforceZeroBudget(bool zero_budget) {
1655 SetManagedMemoryPolicy(cached_managed_memory_policy_, zero_budget); 1656 SetManagedMemoryPolicy(cached_managed_memory_policy_, zero_budget);
1656 } 1657 }
1657 1658
1658 bool LayerTreeHostImpl::InitializeRenderer( 1659 bool LayerTreeHostImpl::InitializeRenderer(
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
2624 break; 2625 break;
2625 } 2626 }
2626 2627
2627 // Allow for multiple creation requests with the same UIResourceId. The 2628 // Allow for multiple creation requests with the same UIResourceId. The
2628 // previous resource is simply deleted. 2629 // previous resource is simply deleted.
2629 ResourceProvider::ResourceId id = ResourceIdForUIResource(uid); 2630 ResourceProvider::ResourceId id = ResourceIdForUIResource(uid);
2630 if (id) 2631 if (id)
2631 DeleteUIResource(uid); 2632 DeleteUIResource(uid);
2632 id = resource_provider_->CreateResource( 2633 id = resource_provider_->CreateResource(
2633 bitmap->GetSize(), 2634 bitmap->GetSize(),
2634 resource_provider_->best_texture_format(),
2635 wrap_mode, 2635 wrap_mode,
2636 ResourceProvider::TextureUsageAny); 2636 ResourceProvider::TextureUsageAny,
2637 resource_provider_->best_texture_format());
2637 2638
2638 ui_resource_map_[uid] = id; 2639 ui_resource_map_[uid] = id;
2639 resource_provider_->SetPixels(id, 2640 resource_provider_->SetPixels(id,
2640 reinterpret_cast<uint8_t*>(bitmap->GetPixels()), 2641 reinterpret_cast<uint8_t*>(bitmap->GetPixels()),
2641 gfx::Rect(bitmap->GetSize()), 2642 gfx::Rect(bitmap->GetSize()),
2642 gfx::Rect(bitmap->GetSize()), 2643 gfx::Rect(bitmap->GetSize()),
2643 gfx::Vector2d(0, 0)); 2644 gfx::Vector2d(0, 0));
2644 } 2645 }
2645 2646
2646 void LayerTreeHostImpl::DeleteUIResource(UIResourceId uid) { 2647 void LayerTreeHostImpl::DeleteUIResource(UIResourceId uid) {
(...skipping 15 matching lines...) Expand all
2662 2663
2663 ResourceProvider::ResourceId LayerTreeHostImpl::ResourceIdForUIResource( 2664 ResourceProvider::ResourceId LayerTreeHostImpl::ResourceIdForUIResource(
2664 UIResourceId uid) const { 2665 UIResourceId uid) const {
2665 UIResourceMap::const_iterator iter = ui_resource_map_.find(uid); 2666 UIResourceMap::const_iterator iter = ui_resource_map_.find(uid);
2666 if (iter != ui_resource_map_.end()) 2667 if (iter != ui_resource_map_.end())
2667 return iter->second; 2668 return iter->second;
2668 return 0; 2669 return 0;
2669 } 2670 }
2670 2671
2671 } // namespace cc 2672 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698