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

Side by Side Diff: cc/output/overlay_unittest.cc

Issue 2089753003: cc: Use the correct internal format for glCopyTexImage2D calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: copytextureformat: comments 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
« no previous file with comments | « cc/output/output_surface_unittest.cc ('k') | cc/output/renderer_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "cc/base/region.h" 10 #include "cc/base/region.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 DefaultOverlayProcessor::DefaultOverlayProcessor(OutputSurface* surface) 126 DefaultOverlayProcessor::DefaultOverlayProcessor(OutputSurface* surface)
127 : OverlayProcessor(surface) { 127 : OverlayProcessor(surface) {
128 } 128 }
129 129
130 size_t DefaultOverlayProcessor::GetStrategyCount() { 130 size_t DefaultOverlayProcessor::GetStrategyCount() {
131 return strategies_.size(); 131 return strategies_.size();
132 } 132 }
133 133
134 class OverlayOutputSurface : public OutputSurface { 134 class OverlayOutputSurface : public OutputSurface {
135 public: 135 public:
136 explicit OverlayOutputSurface(scoped_refptr<ContextProvider> context_provider) 136 explicit OverlayOutputSurface(
137 : OutputSurface(context_provider, nullptr, nullptr) { 137 scoped_refptr<TestContextProvider> context_provider)
138 : OutputSurface(std::move(context_provider), nullptr, nullptr) {
138 surface_size_ = kDisplaySize; 139 surface_size_ = kDisplaySize;
139 device_scale_factor_ = 1; 140 device_scale_factor_ = 1;
140 is_displayed_as_overlay_plane_ = true; 141 is_displayed_as_overlay_plane_ = true;
141 } 142 }
142 143
143 void SetScaleFactor(float scale_factor) { 144 void SetScaleFactor(float scale_factor) {
144 device_scale_factor_ = scale_factor; 145 device_scale_factor_ = scale_factor;
145 } 146 }
146 147
147 // OutputSurface implementation 148 // OutputSurface implementation
148 void BindFramebuffer() override { 149 void BindFramebuffer() override {
149 OutputSurface::BindFramebuffer(); 150 OutputSurface::BindFramebuffer();
150 bind_framebuffer_count_ += 1; 151 bind_framebuffer_count_ += 1;
151 } 152 }
153 uint32_t GetFramebufferCopyTextureFormat() override {
154 // TestContextProvider has no real framebuffer, just use RGB.
155 return GL_RGB;
156 }
152 void SwapBuffers(CompositorFrame* frame) override { 157 void SwapBuffers(CompositorFrame* frame) override {
153 client_->DidSwapBuffers(); 158 client_->DidSwapBuffers();
154 } 159 }
155 void OnSwapBuffersComplete() override { client_->DidSwapBuffersComplete(); } 160 void OnSwapBuffersComplete() override { client_->DidSwapBuffersComplete(); }
156 161
157 void SetOverlayCandidateValidator(OverlayCandidateValidator* validator) { 162 void SetOverlayCandidateValidator(OverlayCandidateValidator* validator) {
158 overlay_candidate_validator_.reset(validator); 163 overlay_candidate_validator_.reset(validator);
159 } 164 }
160 165
161 OverlayCandidateValidator* GetOverlayCandidateValidator() const override { 166 OverlayCandidateValidator* GetOverlayCandidateValidator() const override {
(...skipping 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 1644
1640 ReturnResourceInUseQuery(resource2); 1645 ReturnResourceInUseQuery(resource2);
1641 ReturnResourceInUseQuery(resource3); 1646 ReturnResourceInUseQuery(resource3);
1642 EXPECT_FALSE(resource_provider_->InUseByConsumer(resource1)); 1647 EXPECT_FALSE(resource_provider_->InUseByConsumer(resource1));
1643 EXPECT_FALSE(resource_provider_->InUseByConsumer(resource2)); 1648 EXPECT_FALSE(resource_provider_->InUseByConsumer(resource2));
1644 EXPECT_FALSE(resource_provider_->InUseByConsumer(resource3)); 1649 EXPECT_FALSE(resource_provider_->InUseByConsumer(resource3));
1645 } 1650 }
1646 1651
1647 } // namespace 1652 } // namespace
1648 } // namespace cc 1653 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/output_surface_unittest.cc ('k') | cc/output/renderer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698