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

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

Issue 21159007: cc: Adding support for RGBA_4444 tile textures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and 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.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <stack> 8 #include <stack>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 11 matching lines...) Expand all
22 #include "cc/debug/overdraw_metrics.h" 22 #include "cc/debug/overdraw_metrics.h"
23 #include "cc/debug/rendering_stats_instrumentation.h" 23 #include "cc/debug/rendering_stats_instrumentation.h"
24 #include "cc/input/top_controls_manager.h" 24 #include "cc/input/top_controls_manager.h"
25 #include "cc/layers/heads_up_display_layer.h" 25 #include "cc/layers/heads_up_display_layer.h"
26 #include "cc/layers/heads_up_display_layer_impl.h" 26 #include "cc/layers/heads_up_display_layer_impl.h"
27 #include "cc/layers/layer.h" 27 #include "cc/layers/layer.h"
28 #include "cc/layers/layer_iterator.h" 28 #include "cc/layers/layer_iterator.h"
29 #include "cc/layers/painted_scrollbar_layer.h" 29 #include "cc/layers/painted_scrollbar_layer.h"
30 #include "cc/layers/render_surface.h" 30 #include "cc/layers/render_surface.h"
31 #include "cc/resources/prioritized_resource_manager.h" 31 #include "cc/resources/prioritized_resource_manager.h"
32 #include "cc/resources/resource_provider.h"
32 #include "cc/resources/ui_resource_client.h" 33 #include "cc/resources/ui_resource_client.h"
33 #include "cc/trees/layer_tree_host_client.h" 34 #include "cc/trees/layer_tree_host_client.h"
34 #include "cc/trees/layer_tree_host_common.h" 35 #include "cc/trees/layer_tree_host_common.h"
35 #include "cc/trees/layer_tree_host_impl.h" 36 #include "cc/trees/layer_tree_host_impl.h"
36 #include "cc/trees/layer_tree_impl.h" 37 #include "cc/trees/layer_tree_impl.h"
37 #include "cc/trees/occlusion_tracker.h" 38 #include "cc/trees/occlusion_tracker.h"
38 #include "cc/trees/single_thread_proxy.h" 39 #include "cc/trees/single_thread_proxy.h"
39 #include "cc/trees/thread_proxy.h" 40 #include "cc/trees/thread_proxy.h"
40 #include "cc/trees/tree_synchronizer.h" 41 #include "cc/trees/tree_synchronizer.h"
41 #include "ui/gfx/size_conversions.h" 42 #include "ui/gfx/size_conversions.h"
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 size_t contents_texture_bytes = 0; 911 size_t contents_texture_bytes = 0;
911 912
912 // Start iteration at 1 to skip the root surface as it does not have a texture 913 // Start iteration at 1 to skip the root surface as it does not have a texture
913 // cost. 914 // cost.
914 for (size_t i = 1; i < update_list.size(); ++i) { 915 for (size_t i = 1; i < update_list.size(); ++i) {
915 Layer* render_surface_layer = update_list.at(i); 916 Layer* render_surface_layer = update_list.at(i);
916 RenderSurface* render_surface = render_surface_layer->render_surface(); 917 RenderSurface* render_surface = render_surface_layer->render_surface();
917 918
918 size_t bytes = 919 size_t bytes =
919 Resource::MemorySizeBytes(render_surface->content_rect().size(), 920 Resource::MemorySizeBytes(render_surface->content_rect().size(),
920 GL_RGBA); 921 GL_RGBA,
922 ResourceProvider::RGBA_8888);
921 contents_texture_bytes += bytes; 923 contents_texture_bytes += bytes;
922 924
923 if (render_surface_layer->background_filters().IsEmpty()) 925 if (render_surface_layer->background_filters().IsEmpty())
924 continue; 926 continue;
925 927
926 if (bytes > max_background_texture_bytes) 928 if (bytes > max_background_texture_bytes)
927 max_background_texture_bytes = bytes; 929 max_background_texture_bytes = bytes;
928 if (!readback_bytes) { 930 if (!readback_bytes) {
929 readback_bytes = Resource::MemorySizeBytes(device_viewport_size_, 931 readback_bytes = Resource::MemorySizeBytes(device_viewport_size_,
930 GL_RGBA); 932 GL_RGBA,
933 ResourceProvider::RGBA_8888);
931 } 934 }
932 } 935 }
933 return readback_bytes + max_background_texture_bytes + contents_texture_bytes; 936 return readback_bytes + max_background_texture_bytes + contents_texture_bytes;
934 } 937 }
935 938
936 void LayerTreeHost::PaintMasksForRenderSurface(Layer* render_surface_layer, 939 void LayerTreeHost::PaintMasksForRenderSurface(Layer* render_surface_layer,
937 ResourceUpdateQueue* queue, 940 ResourceUpdateQueue* queue,
938 bool* did_paint_content, 941 bool* did_paint_content,
939 bool* need_more_updates) { 942 bool* need_more_updates) {
940 // Note: Masks and replicas only exist for layers that own render surfaces. If 943 // Note: Masks and replicas only exist for layers that own render surfaces. If
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1184 UIResourceRequest request; 1187 UIResourceRequest request;
1185 request.type = UIResourceRequest::UIResourceCreate; 1188 request.type = UIResourceRequest::UIResourceCreate;
1186 request.id = uid; 1189 request.id = uid;
1187 request.bitmap = iter->second->GetBitmap(uid, resource_lost); 1190 request.bitmap = iter->second->GetBitmap(uid, resource_lost);
1188 DCHECK(request.bitmap.get()); 1191 DCHECK(request.bitmap.get());
1189 ui_resource_request_queue_.push_back(request); 1192 ui_resource_request_queue_.push_back(request);
1190 } 1193 }
1191 } 1194 }
1192 1195
1193 } // namespace cc 1196 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698