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

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

Issue 2096493002: Make cc::CompositorFrames movable [Part 1 of 2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix reflector Created 4 years, 6 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
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/test/pixel_test_output_surface.h" 5 #include "cc/test/pixel_test_output_surface.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "cc/output/compositor_frame.h"
9 #include "cc/output/output_surface_client.h" 10 #include "cc/output/output_surface_client.h"
10 #include "third_party/khronos/GLES2/gl2.h" 11 #include "third_party/khronos/GLES2/gl2.h"
11 #include "ui/gfx/transform.h" 12 #include "ui/gfx/transform.h"
12 13
13 namespace cc { 14 namespace cc {
14 15
15 PixelTestOutputSurface::PixelTestOutputSurface( 16 PixelTestOutputSurface::PixelTestOutputSurface(
16 scoped_refptr<ContextProvider> context_provider, 17 scoped_refptr<ContextProvider> context_provider,
17 scoped_refptr<ContextProvider> worker_context_provider, 18 scoped_refptr<ContextProvider> worker_context_provider,
18 bool flipped_output_surface) 19 bool flipped_output_surface)
(...skipping 24 matching lines...) Expand all
43 bool has_alpha) { 44 bool has_alpha) {
44 gfx::Size expanded_size(size.width() + surface_expansion_size_.width(), 45 gfx::Size expanded_size(size.width() + surface_expansion_size_.width(),
45 size.height() + surface_expansion_size_.height()); 46 size.height() + surface_expansion_size_.height());
46 OutputSurface::Reshape(expanded_size, scale_factor, has_alpha); 47 OutputSurface::Reshape(expanded_size, scale_factor, has_alpha);
47 } 48 }
48 49
49 bool PixelTestOutputSurface::HasExternalStencilTest() const { 50 bool PixelTestOutputSurface::HasExternalStencilTest() const {
50 return external_stencil_test_; 51 return external_stencil_test_;
51 } 52 }
52 53
53 void PixelTestOutputSurface::SwapBuffers(CompositorFrame* frame) { 54 void PixelTestOutputSurface::SwapBuffers(
55 std::unique_ptr<CompositorFrame> frame) {
54 PostSwapBuffersComplete(); 56 PostSwapBuffersComplete();
55 client_->DidSwapBuffers(); 57 client_->DidSwapBuffers();
56 } 58 }
57 59
58 uint32_t PixelTestOutputSurface::GetFramebufferCopyTextureFormat() { 60 uint32_t PixelTestOutputSurface::GetFramebufferCopyTextureFormat() {
59 // This format will work if the |context_provider| has an RGB or RGBA 61 // This format will work if the |context_provider| has an RGB or RGBA
60 // framebuffer. For now assume tests do not want/care about alpha in 62 // framebuffer. For now assume tests do not want/care about alpha in
61 // the root render pass. 63 // the root render pass.
62 return GL_RGB; 64 return GL_RGB;
63 } 65 }
64 66
65 } // namespace cc 67 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698