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

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

Issue 53633003: Do not give GPU memory to backgrounded compositors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove test Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/layer_tree_host_unittest.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/layers/append_quads_data.h" 5 #include "cc/layers/append_quads_data.h"
6 #include "cc/layers/content_layer_client.h" 6 #include "cc/layers/content_layer_client.h"
7 #include "cc/layers/picture_layer.h" 7 #include "cc/layers/picture_layer.h"
8 #include "cc/layers/picture_layer_impl.h" 8 #include "cc/layers/picture_layer_impl.h"
9 #include "cc/quads/draw_quad.h" 9 #include "cc/quads/draw_quad.h"
10 #include "cc/test/layer_tree_pixel_test.h" 10 #include "cc/test/layer_tree_pixel_test.h"
(...skipping 12 matching lines...) Expand all
23 class LayerTreeHostOnDemandRasterPixelTest : public LayerTreePixelTest { 23 class LayerTreeHostOnDemandRasterPixelTest : public LayerTreePixelTest {
24 public: 24 public:
25 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { 25 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
26 settings->impl_side_painting = true; 26 settings->impl_side_painting = true;
27 } 27 }
28 28
29 virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) OVERRIDE { 29 virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) OVERRIDE {
30 // Not enough memory available. Enforce on-demand rasterization. 30 // Not enough memory available. Enforce on-demand rasterization.
31 impl->SetMemoryPolicy( 31 impl->SetMemoryPolicy(
32 ManagedMemoryPolicy(1, gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING, 32 ManagedMemoryPolicy(1, gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING,
33 1, gpu::MemoryAllocation::CUTOFF_ALLOW_NOTHING,
34 1000)); 33 1000));
35 impl->SetDiscardBackBufferWhenNotVisible(true);
36 } 34 }
37 35
38 virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, 36 virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
39 bool result) OVERRIDE { 37 bool result) OVERRIDE {
40 // Find the PictureLayerImpl ask it to append quads to check their material. 38 // Find the PictureLayerImpl ask it to append quads to check their material.
41 // The PictureLayerImpl is assumed to be the first child of the root layer 39 // The PictureLayerImpl is assumed to be the first child of the root layer
42 // in the active tree. 40 // in the active tree.
43 PictureLayerImpl* picture_layer = static_cast<PictureLayerImpl*>( 41 PictureLayerImpl* picture_layer = static_cast<PictureLayerImpl*>(
44 host_impl->active_tree()->root_layer()->child_at(0)); 42 host_impl->active_tree()->root_layer()->child_at(0));
45 43
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 101
104 RunPixelTest(GL_WITH_BITMAP, 102 RunPixelTest(GL_WITH_BITMAP,
105 layer, 103 layer,
106 base::FilePath(FILE_PATH_LITERAL("blue_yellow.png"))); 104 base::FilePath(FILE_PATH_LITERAL("blue_yellow.png")));
107 } 105 }
108 106
109 } // namespace 107 } // namespace
110 } // namespace cc 108 } // namespace cc
111 109
112 #endif // OS_ANDROID 110 #endif // OS_ANDROID
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698