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

Unified Diff: cc/test/fake_output_surface.cc

Issue 2399983003: cc: Make OutputSurface::Reshape abstract (Closed)
Patch Set: reshapeabstract: . Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/fake_output_surface.h ('k') | cc/test/pixel_test_output_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_output_surface.cc
diff --git a/cc/test/fake_output_surface.cc b/cc/test/fake_output_surface.cc
index 7d5a296b32e4d26de065c3d1320f6fd454212b6b..a096f7f37c7160ec8bff102da25d13d5b8da750b 100644
--- a/cc/test/fake_output_surface.cc
+++ b/cc/test/fake_output_surface.cc
@@ -15,14 +15,30 @@ namespace cc {
FakeOutputSurface::FakeOutputSurface(
scoped_refptr<ContextProvider> context_provider)
- : OutputSurface(std::move(context_provider)) {}
+ : OutputSurface(std::move(context_provider)) {
+ DCHECK(OutputSurface::context_provider());
+}
FakeOutputSurface::FakeOutputSurface(
std::unique_ptr<SoftwareOutputDevice> software_device)
- : OutputSurface(std::move(software_device)) {}
+ : OutputSurface(std::move(software_device)) {
+ DCHECK(OutputSurface::software_device());
+}
FakeOutputSurface::~FakeOutputSurface() = default;
+void FakeOutputSurface::Reshape(const gfx::Size& size,
+ float device_scale_factor,
+ const gfx::ColorSpace& color_space,
+ bool has_alpha) {
+ if (context_provider()) {
+ context_provider()->ContextGL()->ResizeCHROMIUM(
+ size.width(), size.height(), device_scale_factor, has_alpha);
+ } else {
+ software_device()->Resize(size, device_scale_factor);
+ }
+}
+
void FakeOutputSurface::SwapBuffers(OutputSurfaceFrame frame) {
last_sent_frame_.reset(new OutputSurfaceFrame(std::move(frame)));
++num_sent_frames_;
« no previous file with comments | « cc/test/fake_output_surface.h ('k') | cc/test/pixel_test_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698