Merge pull request #1391 from chinmaygarde/master

Run a CPPLint pass on sky/compositor
This commit is contained in:
Chinmay Garde 2015-09-29 12:03:04 -07:00
commit 2459b3a026
9 changed files with 15 additions and 15 deletions

View File

@ -5,11 +5,9 @@
#ifndef SKY_COMPOSITOR_COMPOSITOR_OPTIONS_H_
#define SKY_COMPOSITOR_COMPOSITOR_OPTIONS_H_
#include "base/macros.h"
#include <stdint.h>
#include <vector>
#include "base/macros.h"
namespace sky {
namespace compositor {

View File

@ -5,6 +5,7 @@
#ifndef SKY_COMPOSITOR_CONTAINER_LAYER_H_
#define SKY_COMPOSITOR_CONTAINER_LAYER_H_
#include <vector>
#include "sky/compositor/layer.h"
namespace sky {

View File

@ -44,7 +44,7 @@ void Stopwatch::visualize(SkCanvas& canvas, const SkRect& rect) const {
path.moveTo(0, 0);
path.lineTo(0, height * (_laps[0].InMillisecondsF() / 16.0));
for (size_t i = 0; i < kMaxSamples; i++) {
path.lineTo(width * ((double)i / kMaxSamples),
path.lineTo(width * (static_cast<double>(i) / kMaxSamples),
height * (_laps[i].InMillisecondsF() / 16.0));
}
path.lineTo(width, 0);
@ -58,7 +58,7 @@ void Stopwatch::visualize(SkCanvas& canvas, const SkRect& rect) const {
paint.setColor(0xFF00FF00);
paint.setStrokeWidth(3);
paint.setStyle(SkPaint::Style::kStroke_Style);
auto sampleX = width * ((double)_current_sample / kMaxSamples);
auto sampleX = width * (static_cast<double>(_current_sample) / kMaxSamples);
canvas.drawLine(sampleX, 0, sampleX, height, paint);
}

View File

@ -5,12 +5,11 @@
#ifndef SKY_COMPOSITOR_INSTRUMENTATION_H_
#define SKY_COMPOSITOR_INSTRUMENTATION_H_
#include <vector>
#include "base/macros.h"
#include "base/time/time.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include <vector>
namespace sky {
namespace compositor {
namespace instrumentation {

View File

@ -36,7 +36,7 @@ PaintContext::ScopedFrame PaintContext::AcquireFrame(
PaintContext::ScopedFrame::ScopedFrame(PaintContext& context, SkCanvas& canvas)
: context_(context), canvas_(&canvas) {
context_.beginFrame(*this);
};
}
PaintContext::ScopedFrame::ScopedFrame(ScopedFrame&& frame) = default;
@ -51,7 +51,7 @@ PaintContext::ScopedFrame::ScopedFrame(PaintContext& context,
canvas_ = trace_recorder_->getRecordingCanvas();
DCHECK(canvas_);
context_.beginFrame(*this);
};
}
PaintContext::ScopedFrame::~ScopedFrame() {
context_.endFrame(*this);

View File

@ -2,10 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SKY_COMPOSITOR_PAINT_CONTEXT_CC_
#define SKY_COMPOSITOR_PAINT_CONTEXT_CC_
#ifndef SKY_COMPOSITOR_PAINT_CONTEXT_H_
#define SKY_COMPOSITOR_PAINT_CONTEXT_H_
#include <memory>
#include <string>
#include "base/macros.h"
#include "base/logging.h"
@ -23,7 +24,7 @@ class PaintContext {
public:
SkCanvas& canvas() { return *canvas_; }
const PaintContext& context() const { return context_; };
const PaintContext& context() const { return context_; }
ScopedFrame(ScopedFrame&& frame);
@ -71,4 +72,4 @@ class PaintContext {
} // namespace compositor
} // namespace sky
#endif // SKY_COMPOSITOR_PAINT_CONTEXT_CC_
#endif // SKY_COMPOSITOR_PAINT_CONTEXT_H_

View File

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <vector>
#include "sky/compositor/picture_serializer.h"
#include "third_party/skia/include/core/SkData.h"
#include "third_party/skia/include/core/SkPixelSerializer.h"
#include "third_party/skia/include/core/SkStream.h"

View File

@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <string>
#include "sky/compositor/statistics_layer.h"
namespace sky {

View File

@ -14,7 +14,7 @@ namespace compositor {
class StatisticsLayer : public Layer {
public:
StatisticsLayer(uint64_t enabledOptions);
explicit StatisticsLayer(uint64_t enabledOptions);
void Paint(PaintContext::ScopedFrame& frame) override;