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

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

Issue 2317493003: cc: Toward merging DrawFrame and SwapBuffers in DelegatingRenderer. (Closed)
Patch Set: merge-draw-swap: add-draw-result-checks Created 4 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_impl.cc ('k') | cc/trees/proxy_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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 6929 matching lines...) Expand 10 before | Expand all | Expand 10 after
6940 // Makes sure that painted_device_scale_factor is propagated to the 6940 // Makes sure that painted_device_scale_factor is propagated to the
6941 // frame's metadata. 6941 // frame's metadata.
6942 class LayerTreeHostTestPaintedDeviceScaleFactor : public LayerTreeHostTest { 6942 class LayerTreeHostTestPaintedDeviceScaleFactor : public LayerTreeHostTest {
6943 protected: 6943 protected:
6944 void BeginTest() override { 6944 void BeginTest() override {
6945 layer_tree()->SetPaintedDeviceScaleFactor(2.0f); 6945 layer_tree()->SetPaintedDeviceScaleFactor(2.0f);
6946 EXPECT_EQ(1.0f, layer_tree()->device_scale_factor()); 6946 EXPECT_EQ(1.0f, layer_tree()->device_scale_factor());
6947 PostSetNeedsCommitToMainThread(); 6947 PostSetNeedsCommitToMainThread();
6948 } 6948 }
6949 6949
6950 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { 6950 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
6951 LayerTreeHostImpl::FrameData* frame_data,
6952 DrawResult draw_result) override {
6953 EXPECT_EQ(DRAW_SUCCESS, draw_result);
6951 EXPECT_EQ(2.0f, host_impl->active_tree()->painted_device_scale_factor()); 6954 EXPECT_EQ(2.0f, host_impl->active_tree()->painted_device_scale_factor());
6952 EXPECT_EQ(1.0f, host_impl->active_tree()->device_scale_factor()); 6955 EXPECT_EQ(1.0f, host_impl->active_tree()->device_scale_factor());
6956 return draw_result;
6953 } 6957 }
6954 6958
6955 void DisplayReceivedCompositorFrameOnThread( 6959 void DisplayReceivedCompositorFrameOnThread(
6956 const CompositorFrame& frame) override { 6960 const CompositorFrame& frame) override {
6957 EXPECT_EQ(2.0f, frame.metadata.device_scale_factor); 6961 EXPECT_EQ(2.0f, frame.metadata.device_scale_factor);
6958 EndTest(); 6962 EndTest();
6959 } 6963 }
6960 6964
6961 void AfterTest() override {} 6965 void AfterTest() override {}
6962 }; 6966 };
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
7036 private: 7040 private:
7037 FakeContentLayerClient client_; 7041 FakeContentLayerClient client_;
7038 const gfx::Size viewport_size_; 7042 const gfx::Size viewport_size_;
7039 const gfx::Size large_image_size_; 7043 const gfx::Size large_image_size_;
7040 }; 7044 };
7041 7045
7042 SINGLE_AND_MULTI_THREAD_TEST_F(GpuRasterizationSucceedsWithLargeImage); 7046 SINGLE_AND_MULTI_THREAD_TEST_F(GpuRasterizationSucceedsWithLargeImage);
7043 7047
7044 } // namespace 7048 } // namespace
7045 } // namespace cc 7049 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/proxy_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698