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

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: fixed a signed vs. unsigned comparison in video_resource_updater.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
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl.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 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 29 matching lines...) Expand all
40 #include "cc/trees/tree_synchronizer.h" 40 #include "cc/trees/tree_synchronizer.h"
41 #include "ui/gfx/size_conversions.h" 41 #include "ui/gfx/size_conversions.h"
42 42
43 namespace { 43 namespace {
44 static int s_num_layer_tree_instances; 44 static int s_num_layer_tree_instances;
45 } 45 }
46 46
47 namespace cc { 47 namespace cc {
48 48
49 RendererCapabilities::RendererCapabilities() 49 RendererCapabilities::RendererCapabilities()
50 : best_texture_format(0), 50 : best_texture_format(RGBA_8888),
51 using_partial_swap(false), 51 using_partial_swap(false),
52 using_set_visibility(false), 52 using_set_visibility(false),
53 using_egl_image(false), 53 using_egl_image(false),
54 allow_partial_texture_updates(false), 54 allow_partial_texture_updates(false),
55 using_offscreen_context3d(false), 55 using_offscreen_context3d(false),
56 max_texture_size(0), 56 max_texture_size(0),
57 avoid_pow2_textures(false), 57 avoid_pow2_textures(false),
58 using_map_image(false), 58 using_map_image(false),
59 using_shared_memory_resources(false), 59 using_shared_memory_resources(false),
60 using_discard_framebuffer(false) {} 60 using_discard_framebuffer(false) {}
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 settings_.max_partial_texture_updates, 190 settings_.max_partial_texture_updates,
191 proxy_->MaxPartialTextureUpdates()); 191 proxy_->MaxPartialTextureUpdates());
192 } 192 }
193 settings_.max_partial_texture_updates = max_partial_texture_updates; 193 settings_.max_partial_texture_updates = max_partial_texture_updates;
194 194
195 if (!contents_texture_manager_ && 195 if (!contents_texture_manager_ &&
196 (!settings_.impl_side_painting || !settings_.solid_color_scrollbars)) { 196 (!settings_.impl_side_painting || !settings_.solid_color_scrollbars)) {
197 contents_texture_manager_ = 197 contents_texture_manager_ =
198 PrioritizedResourceManager::Create(proxy_.get()); 198 PrioritizedResourceManager::Create(proxy_.get());
199 surface_memory_placeholder_ = 199 surface_memory_placeholder_ =
200 contents_texture_manager_->CreateTexture(gfx::Size(), GL_RGBA); 200 contents_texture_manager_->CreateTexture(gfx::Size(), RGBA_8888);
201 } 201 }
202 202
203 client_->DidInitializeOutputSurface(true); 203 client_->DidInitializeOutputSurface(true);
204 return CreateSucceeded; 204 return CreateSucceeded;
205 } 205 }
206 206
207 // Failure path. 207 // Failure path.
208 208
209 client_->DidFailToInitializeOutputSurface(); 209 client_->DidFailToInitializeOutputSurface();
210 210
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 size_t contents_texture_bytes = 0; 923 size_t contents_texture_bytes = 0;
924 924
925 // Start iteration at 1 to skip the root surface as it does not have a texture 925 // Start iteration at 1 to skip the root surface as it does not have a texture
926 // cost. 926 // cost.
927 for (size_t i = 1; i < update_list.size(); ++i) { 927 for (size_t i = 1; i < update_list.size(); ++i) {
928 Layer* render_surface_layer = update_list.at(i); 928 Layer* render_surface_layer = update_list.at(i);
929 RenderSurface* render_surface = render_surface_layer->render_surface(); 929 RenderSurface* render_surface = render_surface_layer->render_surface();
930 930
931 size_t bytes = 931 size_t bytes =
932 Resource::MemorySizeBytes(render_surface->content_rect().size(), 932 Resource::MemorySizeBytes(render_surface->content_rect().size(),
933 GL_RGBA); 933 RGBA_8888);
934 contents_texture_bytes += bytes; 934 contents_texture_bytes += bytes;
935 935
936 if (render_surface_layer->background_filters().IsEmpty()) 936 if (render_surface_layer->background_filters().IsEmpty())
937 continue; 937 continue;
938 938
939 if (bytes > max_background_texture_bytes) 939 if (bytes > max_background_texture_bytes)
940 max_background_texture_bytes = bytes; 940 max_background_texture_bytes = bytes;
941 if (!readback_bytes) { 941 if (!readback_bytes) {
942 readback_bytes = Resource::MemorySizeBytes(device_viewport_size_, 942 readback_bytes = Resource::MemorySizeBytes(device_viewport_size_,
943 GL_RGBA); 943 RGBA_8888);
944 } 944 }
945 } 945 }
946 return readback_bytes + max_background_texture_bytes + contents_texture_bytes; 946 return readback_bytes + max_background_texture_bytes + contents_texture_bytes;
947 } 947 }
948 948
949 void LayerTreeHost::PaintMasksForRenderSurface(Layer* render_surface_layer, 949 void LayerTreeHost::PaintMasksForRenderSurface(Layer* render_surface_layer,
950 ResourceUpdateQueue* queue, 950 ResourceUpdateQueue* queue,
951 bool* did_paint_content, 951 bool* did_paint_content,
952 bool* need_more_updates) { 952 bool* need_more_updates) {
953 // Note: Masks and replicas only exist for layers that own render surfaces. If 953 // Note: Masks and replicas only exist for layers that own render surfaces. If
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
1207 void LayerTreeHost::RegisterViewportLayers( 1207 void LayerTreeHost::RegisterViewportLayers(
1208 scoped_refptr<Layer> page_scale_layer, 1208 scoped_refptr<Layer> page_scale_layer,
1209 scoped_refptr<Layer> inner_viewport_scroll_layer, 1209 scoped_refptr<Layer> inner_viewport_scroll_layer,
1210 scoped_refptr<Layer> outer_viewport_scroll_layer) { 1210 scoped_refptr<Layer> outer_viewport_scroll_layer) {
1211 page_scale_layer_ = page_scale_layer; 1211 page_scale_layer_ = page_scale_layer;
1212 inner_viewport_scroll_layer_ = inner_viewport_scroll_layer; 1212 inner_viewport_scroll_layer_ = inner_viewport_scroll_layer;
1213 outer_viewport_scroll_layer_ = outer_viewport_scroll_layer; 1213 outer_viewport_scroll_layer_ = outer_viewport_scroll_layer;
1214 } 1214 }
1215 1215
1216 } // namespace cc 1216 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698