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

Side by Side Diff: cc/test/fake_output_surface.cc

Issue 23961003: cc: Remove most methods from RendererClient. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rendererclient: rebase 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 | Annotate | Revision Log
« no previous file with comments | « cc/test/fake_output_surface.h ('k') | cc/test/fake_output_surface_client.h » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/test/fake_output_surface.h" 5 #include "cc/test/fake_output_surface.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "cc/output/compositor_frame_ack.h" 9 #include "cc/output/compositor_frame_ack.h"
10 #include "cc/output/output_surface_client.h" 10 #include "cc/output/output_surface_client.h"
11 #include "cc/resources/returned_resource.h" 11 #include "cc/resources/returned_resource.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace cc { 14 namespace cc {
15 15
16 FakeOutputSurface::FakeOutputSurface( 16 FakeOutputSurface::FakeOutputSurface(
17 scoped_refptr<ContextProvider> context_provider, 17 scoped_refptr<ContextProvider> context_provider,
18 bool delegated_rendering) 18 bool delegated_rendering)
19 : OutputSurface(context_provider), 19 : OutputSurface(context_provider),
20 client_(NULL), 20 client_(NULL),
21 num_sent_frames_(0), 21 num_sent_frames_(0),
22 needs_begin_frame_(false), 22 needs_begin_frame_(false),
23 forced_draw_to_software_device_(false), 23 forced_draw_to_software_device_(false),
24 has_external_stencil_test_(false),
24 fake_weak_ptr_factory_(this) { 25 fake_weak_ptr_factory_(this) {
25 if (delegated_rendering) { 26 if (delegated_rendering) {
26 capabilities_.delegated_rendering = true; 27 capabilities_.delegated_rendering = true;
27 capabilities_.max_frames_pending = 1; 28 capabilities_.max_frames_pending = 1;
28 } 29 }
29 } 30 }
30 31
31 FakeOutputSurface::FakeOutputSurface( 32 FakeOutputSurface::FakeOutputSurface(
32 scoped_ptr<SoftwareOutputDevice> software_device, bool delegated_rendering) 33 scoped_ptr<SoftwareOutputDevice> software_device,
34 bool delegated_rendering)
33 : OutputSurface(software_device.Pass()), 35 : OutputSurface(software_device.Pass()),
34 client_(NULL), 36 client_(NULL),
35 num_sent_frames_(0), 37 num_sent_frames_(0),
36 forced_draw_to_software_device_(false), 38 forced_draw_to_software_device_(false),
39 has_external_stencil_test_(false),
37 fake_weak_ptr_factory_(this) { 40 fake_weak_ptr_factory_(this) {
38 if (delegated_rendering) { 41 if (delegated_rendering) {
39 capabilities_.delegated_rendering = true; 42 capabilities_.delegated_rendering = true;
40 capabilities_.max_frames_pending = 1; 43 capabilities_.max_frames_pending = 1;
41 } 44 }
42 } 45 }
43 46
44 FakeOutputSurface::FakeOutputSurface( 47 FakeOutputSurface::FakeOutputSurface(
45 scoped_refptr<ContextProvider> context_provider, 48 scoped_refptr<ContextProvider> context_provider,
46 scoped_ptr<SoftwareOutputDevice> software_device, 49 scoped_ptr<SoftwareOutputDevice> software_device,
47 bool delegated_rendering) 50 bool delegated_rendering)
48 : OutputSurface(context_provider, software_device.Pass()), 51 : OutputSurface(context_provider, software_device.Pass()),
49 client_(NULL), 52 client_(NULL),
50 num_sent_frames_(0), 53 num_sent_frames_(0),
51 forced_draw_to_software_device_(false), 54 forced_draw_to_software_device_(false),
55 has_external_stencil_test_(false),
52 fake_weak_ptr_factory_(this) { 56 fake_weak_ptr_factory_(this) {
53 if (delegated_rendering) { 57 if (delegated_rendering) {
54 capabilities_.delegated_rendering = true; 58 capabilities_.delegated_rendering = true;
55 capabilities_.max_frames_pending = 1; 59 capabilities_.max_frames_pending = 1;
56 } 60 }
57 } 61 }
58 62
59 FakeOutputSurface::~FakeOutputSurface() {} 63 FakeOutputSurface::~FakeOutputSurface() {}
60 64
61 void FakeOutputSurface::SwapBuffers(CompositorFrame* frame) { 65 void FakeOutputSurface::SwapBuffers(CompositorFrame* frame) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 it != resources_held_by_parent_.end(); 128 it != resources_held_by_parent_.end();
125 ++it) { 129 ++it) {
126 if (it->id == id) 130 if (it->id == id)
127 break; 131 break;
128 } 132 }
129 DCHECK(it != resources_held_by_parent_.end()); 133 DCHECK(it != resources_held_by_parent_.end());
130 ack->resources.push_back(it->ToReturnedResource()); 134 ack->resources.push_back(it->ToReturnedResource());
131 resources_held_by_parent_.erase(it); 135 resources_held_by_parent_.erase(it);
132 } 136 }
133 137
138 bool FakeOutputSurface::HasExternalStencilTest() const {
139 return has_external_stencil_test_;
140 }
141
134 } // namespace cc 142 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_output_surface.h ('k') | cc/test/fake_output_surface_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698