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

Unified Diff: sky/engine/core/rendering/RenderRemote.cpp

Issue 708903002: Initial work on a new <view> element backed by a mojo::View. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: sky/engine/core/rendering/RenderRemote.cpp
diff --git a/sky/engine/platform/graphics/FrameData.cpp b/sky/engine/core/rendering/RenderRemote.cpp
similarity index 57%
copy from sky/engine/platform/graphics/FrameData.cpp
copy to sky/engine/core/rendering/RenderRemote.cpp
index 351b30a049c0dda7702bca15c03399ba5fb10dff..b1232dceef2d64a97d2832c5bf598780c5fbd80a 100644
--- a/sky/engine/platform/graphics/FrameData.cpp
+++ b/sky/engine/core/rendering/RenderRemote.cpp
@@ -1,6 +1,5 @@
/*
- * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
- * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -25,42 +24,38 @@
*/
#include "config.h"
-#include "platform/graphics/FrameData.h"
-#include "platform/graphics/skia/NativeImageSkia.h"
+#include "core/rendering/RenderRemote.h"
+
+#include "core/editing/FrameSelection.h"
+#include "core/html/HTMLViewElement.h"
+#include "core/rendering/PaintInfo.h"
+#include "platform/geometry/LayoutPoint.h"
namespace blink {
-FrameData::FrameData()
- : m_frame(nullptr)
- , m_orientation(DefaultImageOrientation)
- , m_duration(0)
- , m_haveMetadata(false)
- , m_isComplete(false)
- , m_hasAlpha(true)
- , m_frameBytes(0)
+RenderRemote::RenderRemote(HTMLViewElement* view)
+ : RenderReplaced(view)
{
}
-FrameData::~FrameData()
+RenderRemote::~RenderRemote()
{
- clear(true);
}
-bool FrameData::clear(bool clearMetadata)
-{
- if (clearMetadata)
- m_haveMetadata = false;
-
- m_orientation = DefaultImageOrientation;
- m_frameBytes = 0;
-
- if (m_frame) {
- m_frame.clear();
-
- return true;
- }
- return false;
+void RenderRemote::paintReplaced(PaintInfo& paintInfo,
+ const LayoutPoint& paintOffset) {
+ // Draw a gray background. This should be painted over by the actual
+ // content.
+ // TODO(mpcomplete): figure out what we should actually do here.
+ GraphicsContext* context = paintInfo.context;
+
+ IntRect paintRect = pixelSnappedIntRect(LayoutRect(
+ paintOffset.x(), paintOffset.y(), contentWidth(), contentHeight()));
+ context->setStrokeStyle(SolidStroke);
+ context->setStrokeColor(Color::lightGray);
+ context->setFillColor(Color::darkGray);
+ context->drawRect(paintRect);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698