diff options
-rw-r--r-- | content/browser/renderer_host/render_view_host.cc | 5 | ||||
-rw-r--r-- | content/common/view_messages.h | 5 | ||||
-rw-r--r-- | content/public/common/content_switches.cc | 4 | ||||
-rw-r--r-- | content/public/common/content_switches.h | 1 | ||||
-rw-r--r-- | content/renderer/render_widget.cc | 49 | ||||
-rw-r--r-- | content/renderer/render_widget.h | 7 | ||||
-rw-r--r-- | skia/skia.gyp | 1 |
7 files changed, 1 insertions, 71 deletions
diff --git a/content/browser/renderer_host/render_view_host.cc b/content/browser/renderer_host/render_view_host.cc index 6d610b0..24e09f5 100644 --- a/content/browser/renderer_host/render_view_host.cc +++ b/content/browser/renderer_host/render_view_host.cc @@ -45,7 +45,6 @@ #include "content/public/browser/user_metrics.h" #include "content/public/common/bindings_policy.h" #include "content/public/common/content_constants.h" -#include "content/public/common/content_switches.h" #include "content/public/common/result_codes.h" #include "content/public/common/url_constants.h" #include "net/base/net_util.h" @@ -210,10 +209,6 @@ bool RenderViewHost::CreateRenderView(const string16& frame_name, // Let our delegate know that we created a RenderView. delegate_->RenderViewCreated(this); - // Invert the color scheme if a flag was set. - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInvertWebContent)) - Send(new ViewMsg_InvertWebContent(routing_id(), true)); - FOR_EACH_OBSERVER( content::RenderViewHostObserver, observers_, RenderViewHostInitialized()); diff --git a/content/common/view_messages.h b/content/common/view_messages.h index d247651..9d90eb1 100644 --- a/content/common/view_messages.h +++ b/content/common/view_messages.h @@ -2016,8 +2016,3 @@ IPC_MESSAGE_ROUTED0(ViewHostMsg_UnlockMouse) IPC_MESSAGE_ROUTED2(ViewHostMsg_DomOperationResponse, std::string /* json_string */, int /* automation_id */) - -// Enable or disable inverting of web content pixels, for users who prefer -// white-on-black. -IPC_MESSAGE_ROUTED1(ViewMsg_InvertWebContent, - bool /* invert */) diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc index 0bec7fa..6baf3c7 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc @@ -373,10 +373,6 @@ const char kInProcessPlugins[] = "in-process-plugins"; // Runs WebGL inside the renderer process. const char kInProcessWebGL[] = "in-process-webgl"; -// Invert web content pixels, for users who prefer white-on-black. -// (Temporary, just during development and testing of this feature.) -const char kInvertWebContent[] = "invert-web-content"; - // Specifies the flags passed to JS engine const char kJavaScriptFlags[] = "js-flags"; diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h index f271ebd..6802555 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h @@ -117,7 +117,6 @@ CONTENT_EXPORT extern const char kIgnoreGpuBlacklist[]; extern const char kInProcessGPU[]; extern const char kInProcessPlugins[]; CONTENT_EXPORT extern const char kInProcessWebGL[]; -CONTENT_EXPORT extern const char kInvertWebContent[]; CONTENT_EXPORT extern const char kJavaScriptFlags[]; extern const char kLoadPlugin[]; CONTENT_EXPORT extern const char kLoggingLevel[]; diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc index 99b3731..bbc4ecc 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc @@ -24,7 +24,6 @@ #include "ipc/ipc_sync_message.h" #include "skia/ext/platform_canvas.h" #include "third_party/skia/include/core/SkShader.h" -#include "third_party/skia/include/effects/SkTableColorFilter.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenu.h" @@ -99,8 +98,7 @@ RenderWidget::RenderWidget(WebKit::WebPopupType popup_type) is_accelerated_compositing_active_(false), animation_update_pending_(false), animation_task_posted_(false), - invalidation_task_posted_(false), - invert_(false) { + invalidation_task_posted_(false) { RenderProcess::current()->AddRefProcess(); DCHECK(RenderThread::Get()); has_disable_gpu_vsync_switch_ = CommandLine::ForCurrentProcess()->HasSwitch( @@ -219,7 +217,6 @@ bool RenderWidget::OnMessageReceived(const IPC::Message& message) { IPC_MESSAGE_HANDLER(ViewMsg_Repaint, OnMsgRepaint) IPC_MESSAGE_HANDLER(ViewMsg_SetTextDirection, OnSetTextDirection) IPC_MESSAGE_HANDLER(ViewMsg_Move_ACK, OnRequestMoveAck) - IPC_MESSAGE_HANDLER(ViewMsg_InvertWebContent, OnInvertWebContent) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled; @@ -590,16 +587,6 @@ void RenderWidget::PaintRect(const gfx::Rect& rect, canvas->translate(static_cast<SkScalar>(-canvas_origin.x()), static_cast<SkScalar>(-canvas_origin.y())); - if (invert_) { - // Draw everything to a temporary bitmap and then apply an - // inverting color map to the result. This is balanced by an extra - // call to canvas->restore(), below. - DCHECK(invert_paint_.get()); - SkRect bounds; - bounds.set(rect.x(), rect.y(), rect.right(), rect.bottom()); - canvas->saveLayer(&bounds, invert_paint_.get()); - } - // If there is a custom background, tile it. if (!background_.empty()) { SkPaint paint; @@ -660,9 +647,6 @@ void RenderWidget::PaintRect(const gfx::Rect& rect, skia::GetTopDevice(*canvas)->accessBitmap(false); } - if (invert_) - canvas->restore(); - PaintDebugBorder(rect, canvas); canvas->restore(); } @@ -1405,37 +1389,6 @@ void RenderWidget::OnSetTextDirection(WebTextDirection direction) { webwidget_->setTextDirection(direction); } -void RenderWidget::OnInvertWebContent(bool invert) { - if (invert_ == invert) - return; - - invert_ = invert; - - if (invert_ && !invert_paint_.get()) { - // Gamma-aware color inversion: each source pixel value x is normally - // displayed on a computer monitor with a gamma correction x^gamma, - // where gamma is typically in the range 1.8...2.2. By approximating - // gamma as exactly 2, the formula to invert one value is sqrt(1 - x^2). - uint8_t table[256]; - for (unsigned int i = 0; i < 256; i++) { - double value = i / 255.0; - value = sqrt(1 - (value * value)); - table[i] = static_cast<uint8_t>(255 * value); - } - - // Create a Skia Paint with this inverting color map. - invert_paint_.reset(new SkPaint()); - invert_paint_->setStyle(SkPaint::kFill_Style); - invert_paint_->setColor(SK_ColorBLACK); - SkColorFilter* filter = SkTableColorFilter::CreateARGB( - NULL, table, table, table); - invert_paint_->setColorFilter(filter); - filter->unref(); - } - - OnMsgRepaint(size_); -} - webkit::ppapi::PluginInstance* RenderWidget::GetBitmapForOptimizedPluginPaint( const gfx::Rect& paint_bounds, TransportDIB** dib, diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h index d1968e0..c1f53cd 100644 --- a/content/renderer/render_widget.h +++ b/content/renderer/render_widget.h @@ -233,7 +233,6 @@ class CONTENT_EXPORT RenderWidget void OnMsgRepaint(const gfx::Size& size_to_paint); void OnSetTextDirection(WebKit::WebTextDirection direction); void OnGetFPS(); - void OnInvertWebContent(bool invert); // Override points to notify derived classes that a paint has happened. // WillInitiatePaint happens when we're about to generate a new bitmap and @@ -496,12 +495,6 @@ class CONTENT_EXPORT RenderWidget // case NULL is added to the queue. std::deque<ViewHostMsg_UpdateRect*> updates_pending_swap_; - // Set to true if we should invert all pixels. - bool invert_; - - // The Skia paint object for inverting. - scoped_ptr<SkPaint> invert_paint_; - DISALLOW_COPY_AND_ASSIGN(RenderWidget); }; diff --git a/skia/skia.gyp b/skia/skia.gyp index 301b0ef..90c2f87 100644 --- a/skia/skia.gyp +++ b/skia/skia.gyp @@ -340,7 +340,6 @@ '../third_party/skia/src/effects/SkPorterDuff.cpp', '../third_party/skia/src/effects/SkPixelXorXfermode.cpp', '../third_party/skia/src/effects/SkRadialGradient_Table.h', - '../third_party/skia/src/effects/SkTableColorFilter.cpp', '../third_party/skia/src/effects/SkTransparentShader.cpp', '../third_party/skia/src/gpu/GrAAHairLinePathRenderer.cpp', |