Skip to content

Commit

Permalink
Add a flag to disable cached picture raster for blink.
Browse files Browse the repository at this point in the history
This makes cc raster directly from the display item list, when the
--disable-cached-picture-raster flag is present, which is what we
can see in tracing, and will help with potential debugging now
that --disable-slimming-paint is gone, until we remove the cached
picture entirely.

R=pdr
TBR=antrim
BUG=543208
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Review URL: https://codereview.chromium.org/1405803002

Cr-Commit-Position: refs/heads/master@{#354323}
  • Loading branch information
danakj authored and Commit bot committed Oct 15, 2015
1 parent 09223dc commit ee38c1c
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 13 deletions.
9 changes: 6 additions & 3 deletions cc/base/switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ namespace switches {

const char kDisableThreadedAnimation[] = "disable-threaded-animation";

// Disables the use of a cached picture for raster in the renderer,
// making raster go directly from the display item list (this is the data
// structure surfaced to tracing). This is useful for debugging to remove
// the cached picture from the pipeline to narrow down bugs.
const char kDisableCachedPictureRaster[] = "disable-cached-picture-raster";

// Disables layer-edge anti-aliasing in the compositor.
const char kDisableCompositedAntialiasing[] =
"disable-composited-antialiasing";
Expand Down Expand Up @@ -44,9 +50,6 @@ const char kStrictLayerPropertyChangeChecking[] =
const char kEnablePropertyTreeVerification[] =
"enable-property-tree-verification";

// Disable partial swap which is needed for some OpenGL drivers / emulators.
const char kUIDisablePartialSwap[] = "ui-disable-partial-swap";

// Use a BeginFrame signal from browser to renderer to schedule rendering.
const char kEnableBeginFrameScheduling[] = "enable-begin-frame-scheduling";

Expand Down
3 changes: 1 addition & 2 deletions cc/base/switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@ namespace switches {

// Switches for the renderer compositor only.
CC_EXPORT extern const char kDisableThreadedAnimation[];
CC_EXPORT extern const char kDisableCachedPictureRaster[];
CC_EXPORT extern const char kDisableCompositedAntialiasing[];
CC_EXPORT extern const char kDisableMainFrameBeforeActivation[];
CC_EXPORT extern const char kEnableMainFrameBeforeActivation[];
CC_EXPORT extern const char kJankInsteadOfCheckerboard[];
CC_EXPORT extern const char kTopControlsHideThreshold[];
CC_EXPORT extern const char kTopControlsShowThreshold[];
CC_EXPORT extern const char kSlowDownRasterScaleFactor[];
CC_EXPORT extern const char kStrictLayerPropertyChangeChecking[];
CC_EXPORT extern const char kEnablePropertyTreeVerification[];

// Switches for both the renderer and ui compositors.
CC_EXPORT extern const char kUIDisablePartialSwap[];
CC_EXPORT extern const char kEnableBeginFrameScheduling[];
CC_EXPORT extern const char kEnableGpuBenchmarking[];

Expand Down
10 changes: 9 additions & 1 deletion cc/blink/web_content_layer_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "cc/blink/web_content_layer_impl.h"

#include "base/command_line.h"
#include "cc/base/switches.h"
#include "cc/blink/web_display_item_list_impl.h"
#include "cc/layers/picture_layer.h"
#include "cc/playback/display_item_list_settings.h"
Expand All @@ -18,6 +20,12 @@ using cc::PictureLayer;

namespace cc_blink {

static bool UseCachedPictureRaster() {
static bool use = !base::CommandLine::ForCurrentProcess()->HasSwitch(
cc::switches::kDisableCachedPictureRaster);
return use;
}

static blink::WebContentLayerClient::PaintingControlSetting
PaintingControlToWeb(
cc::ContentLayerClient::PaintingControlSetting painting_control) {
Expand Down Expand Up @@ -69,7 +77,7 @@ WebContentLayerImpl::PaintContentsToDisplayList(
const gfx::Rect& clip,
cc::ContentLayerClient::PaintingControlSetting painting_control) {
cc::DisplayItemListSettings settings;
settings.use_cached_picture = true;
settings.use_cached_picture = UseCachedPictureRaster();

scoped_refptr<cc::DisplayItemList> display_list =
cc::DisplayItemList::Create(clip, settings);
Expand Down
3 changes: 2 additions & 1 deletion chrome/browser/chromeos/login/chrome_restart_request.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ void DeriveCommandLine(const GURL& start_url,
#if defined(ENABLE_TOPCHROME_MD)
::switches::kTopChromeMD,
#endif
::switches::kUIDisablePartialSwap,
::switches::kUIEnableCompositorAnimationTimelines,
::switches::kUIPrioritizeInGpuProcess,
#if defined(USE_CRAS)
Expand Down Expand Up @@ -185,6 +186,7 @@ void DeriveCommandLine(const GURL& start_url,
// Please keep these in alphabetical order. Non-UI Compositor switches
// here should also be added to
// content/browser/renderer_host/render_process_host_impl.cc.
cc::switches::kDisableCachedPictureRaster,
cc::switches::kDisableCompositedAntialiasing,
cc::switches::kDisableMainFrameBeforeActivation,
cc::switches::kDisableThreadedAnimation,
Expand All @@ -200,7 +202,6 @@ void DeriveCommandLine(const GURL& start_url,
cc::switches::kShowScreenSpaceRects,
cc::switches::kShowSurfaceDamageRects,
cc::switches::kSlowDownRasterScaleFactor,
cc::switches::kUIDisablePartialSwap,
chromeos::switches::kConsumerDeviceManagementUrl,
chromeos::switches::kDbusStub,
chromeos::switches::kDbusUnstubClients,
Expand Down
1 change: 1 addition & 0 deletions content/browser/renderer_host/render_process_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1351,6 +1351,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kVModule,
// Please keep these in alphabetical order. Compositor switches here should
// also be added to chrome/browser/chromeos/login/chrome_restart_request.cc.
cc::switches::kDisableCachedPictureRaster,
cc::switches::kDisableCompositedAntialiasing,
cc::switches::kDisableMainFrameBeforeActivation,
cc::switches::kDisableThreadedAnimation,
Expand Down
8 changes: 4 additions & 4 deletions content/public/common/content_switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ const char kDisableBackingStoreLimit[] = "disable-backing-store-limit";
// features.
const char kDisableBlinkFeatures[] = "disable-blink-features";

// Disable the creation of compositing layers when it would prevent LCD text.
const char kDisablePreferCompositingToLCDText[] =
"disable-prefer-compositing-to-lcd-text";

// Disables HTML5 DB support.
const char kDisableDatabases[] = "disable-databases";

Expand Down Expand Up @@ -216,6 +212,10 @@ const char kDisablePinch[] = "disable-pinch";
// --extra-plugin-dir and --load-plugin switches.
const char kDisablePluginsDiscovery[] = "disable-plugins-discovery";

// Disable the creation of compositing layers when it would prevent LCD text.
const char kDisablePreferCompositingToLCDText[] =
"disable-prefer-compositing-to-lcd-text";

// Disables the Presentation API.
const char kDisablePresentationAPI[] = "disable-presentation-api";

Expand Down
2 changes: 1 addition & 1 deletion content/public/common/content_switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ CONTENT_EXPORT extern const char kDisableAcceleratedJpegDecoding[];
CONTENT_EXPORT extern const char kDisableAcceleratedMjpegDecode[];
CONTENT_EXPORT extern const char kDisableAcceleratedVideoDecode[];
extern const char kDisableBackingStoreLimit[];
CONTENT_EXPORT extern const char kDisablePreferCompositingToLCDText[];
CONTENT_EXPORT extern const char kDisableDatabases[];
CONTENT_EXPORT extern const char kDisableDelayAgnosticAec[];
extern const char kDisableDirectNPAPIRequests[];
Expand All @@ -60,6 +59,7 @@ CONTENT_EXPORT extern const char kDisableHangMonitor[];
CONTENT_EXPORT extern const char kDisableHideInactiveStackedTabCloseButtons[];
extern const char kDisableHistogramCustomizer[];
CONTENT_EXPORT extern const char kDisableLCDText[];
CONTENT_EXPORT extern const char kDisablePreferCompositingToLCDText[];
CONTENT_EXPORT extern const char kEnablePrefixedEncryptedMedia[];
extern const char kDisableKillAfterBadIPC[];
CONTENT_EXPORT extern const char kDisableLocalStorage[];
Expand Down
2 changes: 1 addition & 1 deletion ui/compositor/compositor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Compositor::Compositor(ui::ContextFactory* context_factory,
}
}
settings.renderer_settings.partial_swap_enabled =
!command_line->HasSwitch(cc::switches::kUIDisablePartialSwap);
!command_line->HasSwitch(switches::kUIDisablePartialSwap);
#if defined(OS_WIN)
settings.renderer_settings.finish_rendering_on_resize = true;
#endif
Expand Down
3 changes: 3 additions & 0 deletions ui/compositor/compositor_switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ const char kEnableHardwareOverlays[] = "enable-hardware-overlays";
// Forces tests to produce pixel output when they normally wouldn't.
const char kEnablePixelOutputInTests[] = "enable-pixel-output-in-tests";

// Disable partial swap which is needed for some OpenGL drivers / emulators.
const char kUIDisablePartialSwap[] = "ui-disable-partial-swap";

const char kUIEnableCompositorAnimationTimelines[] =
"ui-enable-compositor-animation-timelines";

Expand Down
1 change: 1 addition & 0 deletions ui/compositor/compositor_switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace switches {

COMPOSITOR_EXPORT extern const char kEnableHardwareOverlays[];
COMPOSITOR_EXPORT extern const char kEnablePixelOutputInTests[];
COMPOSITOR_EXPORT extern const char kUIDisablePartialSwap[];
COMPOSITOR_EXPORT extern const char kUIEnableCompositorAnimationTimelines[];
COMPOSITOR_EXPORT extern const char kUIEnableRGBA4444Textures[];
COMPOSITOR_EXPORT extern const char kUIEnableZeroCopy[];
Expand Down

0 comments on commit ee38c1c

Please sign in to comment.