Commit 25718190 authored by Peng Huang's avatar Peng Huang Committed by Commit Bot

Using PaintCanvas for HUD

To support OOPR, we need switch from SkCanvas to PaintCanvas which is for
OOPR.

Bug: 895568
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I94b5430c7ee8ed2f5140d352214ec43f2ff0f8ad
Reviewed-on: https://chromium-review.googlesource.com/c/1286950
Commit-Queue: Peng Huang <penghuang@chromium.org>
Reviewed-by: default avatarenne <enne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609033}
parent c7bee6dc
This diff is collapsed.
...@@ -14,13 +14,12 @@ ...@@ -14,13 +14,12 @@
#include "base/time/time.h" #include "base/time/time.h"
#include "cc/cc_export.h" #include "cc/cc_export.h"
#include "cc/layers/layer_impl.h" #include "cc/layers/layer_impl.h"
#include "cc/paint/color_space_transfer_cache_entry.h"
#include "cc/resources/memory_history.h" #include "cc/resources/memory_history.h"
#include "cc/resources/resource_pool.h" #include "cc/resources/resource_pool.h"
#include "cc/trees/debug_rect_history.h" #include "cc/trees/debug_rect_history.h"
#include "third_party/skia/include/core/SkRefCnt.h" #include "third_party/skia/include/core/SkRefCnt.h"
class SkCanvas;
class SkPaint;
class SkTypeface; class SkTypeface;
struct SkRect; struct SkRect;
...@@ -31,6 +30,8 @@ class ClientResourceProvider; ...@@ -31,6 +30,8 @@ class ClientResourceProvider;
namespace cc { namespace cc {
class FrameRateCounter; class FrameRateCounter;
class LayerTreeFrameSink; class LayerTreeFrameSink;
class PaintCanvas;
class PaintFlags;
enum class TextAlign { kLeft, kCenter, kRight }; enum class TextAlign { kLeft, kCenter, kRight };
...@@ -95,50 +96,49 @@ class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl { ...@@ -95,50 +96,49 @@ class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl {
void AsValueInto(base::trace_event::TracedValue* dict) const override; void AsValueInto(base::trace_event::TracedValue* dict) const override;
void UpdateHudContents(); void UpdateHudContents();
void DrawHudContents(SkCanvas* canvas); void DrawHudContents(PaintCanvas* canvas);
void DrawText(PaintCanvas* canvas,
int MeasureText(SkPaint* paint, const std::string& text, int size) const; PaintFlags* flags,
void DrawText(SkCanvas* canvas,
SkPaint* paint,
const std::string& text, const std::string& text,
TextAlign align, TextAlign align,
int size, int size,
int x, int x,
int y) const; int y) const;
void DrawText(SkCanvas* canvas, void DrawText(PaintCanvas* canvas,
SkPaint* paint, PaintFlags* flags,
const std::string& text, const std::string& text,
TextAlign align, TextAlign align,
int size, int size,
const SkPoint& pos) const; const SkPoint& pos) const;
void DrawGraphBackground(SkCanvas* canvas, void DrawGraphBackground(PaintCanvas* canvas,
SkPaint* paint, PaintFlags* flags,
const SkRect& bounds) const; const SkRect& bounds) const;
void DrawGraphLines(SkCanvas* canvas, void DrawGraphLines(PaintCanvas* canvas,
SkPaint* paint, PaintFlags* flags,
const SkRect& bounds, const SkRect& bounds,
const Graph& graph) const; const Graph& graph) const;
SkRect DrawFPSDisplay(SkCanvas* canvas, SkRect DrawFPSDisplay(PaintCanvas* canvas,
const FrameRateCounter* fps_counter, const FrameRateCounter* fps_counter,
int right, int right,
int top) const; int top) const;
SkRect DrawMemoryDisplay(SkCanvas* canvas, SkRect DrawMemoryDisplay(PaintCanvas* canvas,
int top, int top,
int right, int right,
int width) const; int width) const;
SkRect DrawGpuRasterizationStatus(SkCanvas* canvas, SkRect DrawGpuRasterizationStatus(PaintCanvas* canvas,
int right, int right,
int top, int top,
int width) const; int width) const;
void DrawDebugRect(SkCanvas* canvas, void DrawDebugRect(PaintCanvas* canvas,
SkPaint* paint, PaintFlags* flags,
const DebugRect& rect, const DebugRect& rect,
SkColor stroke_color, SkColor stroke_color,
SkColor fill_color, SkColor fill_color,
float stroke_width, float stroke_width,
const std::string& label_text) const; const std::string& label_text) const;
void DrawDebugRects(SkCanvas* canvas, DebugRectHistory* debug_rect_history); void DrawDebugRects(PaintCanvas* canvas,
DebugRectHistory* debug_rect_history);
ResourcePool::InUsePoolResource in_flight_resource_; ResourcePool::InUsePoolResource in_flight_resource_;
std::unique_ptr<ResourcePool> pool_; std::unique_ptr<ResourcePool> pool_;
...@@ -159,6 +159,9 @@ class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl { ...@@ -159,6 +159,9 @@ class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl {
base::TimeTicks time_of_last_graph_update_; base::TimeTicks time_of_last_graph_update_;
// color space for OOPR
const RasterColorSpace raster_color_space_;
DISALLOW_COPY_AND_ASSIGN(HeadsUpDisplayLayerImpl); DISALLOW_COPY_AND_ASSIGN(HeadsUpDisplayLayerImpl);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment