flutter_flutter/sky/shell/gpu/ganesh_surface.cc
Adam Barth 5f62ffe1f4 Swith from skia::RefPtr to RefPtr
Now that we can use WTF everywhere, we don't need to use skia::RefPtr.
2015-08-10 14:18:38 -07:00

35 lines
999 B
C++

// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "sky/shell/gpu/ganesh_surface.h"
#include "base/logging.h"
#include "third_party/skia/include/gpu/GrContext.h"
namespace sky {
namespace shell {
GaneshSurface::GaneshSurface(intptr_t window_fbo,
GaneshContext* context,
const gfx::Size& size) {
GrBackendRenderTargetDesc desc;
desc.fWidth = size.width();
desc.fHeight = size.height();
desc.fConfig = kSkia8888_GrPixelConfig;
desc.fOrigin = kBottomLeft_GrSurfaceOrigin;
desc.fRenderTargetHandle = window_fbo;
skia::RefPtr<GrRenderTarget> target = skia::AdoptRef(
context->gr()->textureProvider()->wrapBackendRenderTarget(desc));
DCHECK(target);
surface_ = skia::AdoptRef(SkSurface::NewRenderTargetDirect(target.get()));
DCHECK(surface_);
}
GaneshSurface::~GaneshSurface() {
}
} // namespace shell
} // namespace sky