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

Side by Side Diff: cc/output/gl_renderer.h

Issue 2612023002: cc: Implement overdraw feedback debugging feature. (Closed)
Patch Set: fix typo in comment Created 3 years, 11 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 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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 #ifndef CC_OUTPUT_GL_RENDERER_H_ 5 #ifndef CC_OUTPUT_GL_RENDERER_H_
6 #define CC_OUTPUT_GL_RENDERER_H_ 6 #define CC_OUTPUT_GL_RENDERER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <set>
9 #include <vector> 10 #include <vector>
10 11
11 #include "base/cancelable_callback.h" 12 #include "base/cancelable_callback.h"
12 #include "base/macros.h" 13 #include "base/macros.h"
13 #include "cc/base/cc_export.h" 14 #include "cc/base/cc_export.h"
14 #include "cc/output/color_lut_cache.h" 15 #include "cc/output/color_lut_cache.h"
15 #include "cc/output/context_cache_controller.h" 16 #include "cc/output/context_cache_controller.h"
16 #include "cc/output/direct_renderer.h" 17 #include "cc/output/direct_renderer.h"
17 #include "cc/output/gl_renderer_draw_cache.h" 18 #include "cc/output/gl_renderer_draw_cache.h"
18 #include "cc/output/program_binding.h" 19 #include "cc/output/program_binding.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 const CALayerOverlay* ca_layer_overlay, 264 const CALayerOverlay* ca_layer_overlay,
264 Resource** resource, 265 Resource** resource,
265 DrawingFrame* frame, 266 DrawingFrame* frame,
266 gfx::RectF* new_bounds); 267 gfx::RectF* new_bounds);
267 268
268 // Schedules the |ca_layer_overlay|, which is guaranteed to have a non-null 269 // Schedules the |ca_layer_overlay|, which is guaranteed to have a non-null
269 // |rpdq| parameter. 270 // |rpdq| parameter.
270 void ScheduleRenderPassDrawQuad(const CALayerOverlay* ca_layer_overlay, 271 void ScheduleRenderPassDrawQuad(const CALayerOverlay* ca_layer_overlay,
271 DrawingFrame* external_frame); 272 DrawingFrame* external_frame);
272 273
274 // Setup/flush all pending overdraw feedback to framebuffer.
275 void SetupOverdrawFeedback();
276 void FlushOverdrawFeedback(const DrawingFrame* frame,
277 const gfx::Rect& output_rect);
278 // Process overdraw feedback from query.
279 void OverdrawFeedback(unsigned query, int category, base::Closure barrier);
280 void UpdateOverdrawCounter() const;
281
273 using OverlayResourceLock = 282 using OverlayResourceLock =
274 std::unique_ptr<ResourceProvider::ScopedReadLockGL>; 283 std::unique_ptr<ResourceProvider::ScopedReadLockGL>;
275 using OverlayResourceLockList = std::vector<OverlayResourceLock>; 284 using OverlayResourceLockList = std::vector<OverlayResourceLock>;
276 285
277 // Resources that have been sent to the GPU process, but not yet swapped. 286 // Resources that have been sent to the GPU process, but not yet swapped.
278 OverlayResourceLockList pending_overlay_resources_; 287 OverlayResourceLockList pending_overlay_resources_;
279 288
280 // Resources that should be shortly swapped by the GPU process. 289 // Resources that should be shortly swapped by the GPU process.
281 std::deque<OverlayResourceLockList> swapping_overlay_resources_; 290 std::deque<OverlayResourceLockList> swapping_overlay_resources_;
282 291
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 545
537 // The method FlippedFramebuffer determines whether the framebuffer associated 546 // The method FlippedFramebuffer determines whether the framebuffer associated
538 // with a DrawingFrame is flipped. It makes the assumption that the 547 // with a DrawingFrame is flipped. It makes the assumption that the
539 // DrawingFrame is being used as part of a render pass. If a DrawingFrame is 548 // DrawingFrame is being used as part of a render pass. If a DrawingFrame is
540 // not being used as part of a render pass, setting it here forces 549 // not being used as part of a render pass, setting it here forces
541 // FlippedFramebuffer to return |true|. 550 // FlippedFramebuffer to return |true|.
542 bool force_drawing_frame_framebuffer_unflipped_ = false; 551 bool force_drawing_frame_framebuffer_unflipped_ = false;
543 552
544 BoundGeometry bound_geometry_; 553 BoundGeometry bound_geometry_;
545 ColorLUTCache color_lut_cache_; 554 ColorLUTCache color_lut_cache_;
555
556 std::set<int> current_overdraw_;
danakj 2017/01/12 00:42:58 set is very slow, is there a better structure you
reveman 2017/01/13 01:27:43 FYI, this will become a map in a follow up patch w
557 unsigned offscreen_stencil_renderbuffer_id_ = 0;
558 gfx::Size offscreen_stencil_renderbuffer_size_;
559 struct PendingOverdrawQuery;
560 std::deque<std::unique_ptr<PendingOverdrawQuery>> pending_overdraw_queries_;
danakj 2017/01/12 00:42:58 deque is very costly for memory https://bugs.chrom
reveman 2017/01/13 01:27:43 Removed this completely from latest version of the
561
546 DISALLOW_COPY_AND_ASSIGN(GLRenderer); 562 DISALLOW_COPY_AND_ASSIGN(GLRenderer);
547 }; 563 };
548 564
549 } // namespace cc 565 } // namespace cc
550 566
551 #endif // CC_OUTPUT_GL_RENDERER_H_ 567 #endif // CC_OUTPUT_GL_RENDERER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698