[aseprite] 124/250: Update Skia port to latest Skia version
Tobias Hansen
thansen at moszumanska.debian.org
Sun Dec 20 15:27:20 UTC 2015
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch master
in repository aseprite.
commit e732297cfb164d6e54175c51e9a60f438eceb01c
Author: David Capello <davidcapello at gmail.com>
Date: Fri Oct 2 12:12:37 2015 -0300
Update Skia port to latest Skia version
---
src/she/skia/gl_context_wgl.h | 17 +++++++++++------
src/she/skia/skia_surface.h | 22 ++++++++++++++--------
src/she/skia/skia_system.h | 2 +-
src/she/skia/skia_window_win.cpp | 2 +-
4 files changed, 27 insertions(+), 16 deletions(-)
diff --git a/src/she/skia/gl_context_wgl.h b/src/she/skia/gl_context_wgl.h
index dd5f8bd..7c36bb2 100644
--- a/src/she/skia/gl_context_wgl.h
+++ b/src/she/skia/gl_context_wgl.h
@@ -48,14 +48,15 @@ public:
wglMakeCurrent(hdc, m_glrc);
- fGL.reset(GrGLCreateNativeInterface());
- if (!fGL) {
+ const GrGLInterface* gl = GrGLCreateNativeInterface();
+ init(gl);
+ if (!gl) {
ReleaseDC(m_hwnd, hdc);
destroy();
return;
}
- if (!fGL->validate()) {
+ if (!gl->validate()) {
ReleaseDC(m_hwnd, hdc);
destroy();
return;
@@ -68,18 +69,22 @@ public:
destroy();
}
- void makeCurrent() const override {
+ void onPlatformMakeCurrent() const override {
HDC hdc = GetDC(m_hwnd);
wglMakeCurrent(hdc, m_glrc);
ReleaseDC(m_hwnd, hdc);
}
- void swapBuffers() const override {
+ void onPlatformSwapBuffers() const override {
HDC hdc = GetDC(m_hwnd);
SwapBuffers(hdc);
ReleaseDC(m_hwnd, hdc);
}
+ GrGLFuncPtr onPlatformGetProcAddress(const char* name) const override {
+ return reinterpret_cast<GrGLFuncPtr>(wglGetProcAddress(name));
+ }
+
int getStencilBits() {
HDC hdc = GetDC(m_hwnd);
int pixelFormat = GetPixelFormat(hdc);
@@ -95,7 +100,7 @@ public:
private:
void destroy() {
- fGL.reset(nullptr);
+ teardown();
if (m_glrc) {
wglMakeCurrent(nullptr, nullptr);
diff --git a/src/she/skia/skia_surface.h b/src/she/skia/skia_surface.h
index 0624643..a09ee99 100644
--- a/src/she/skia/skia_surface.h
+++ b/src/she/skia/skia_surface.h
@@ -136,7 +136,8 @@ public:
SkCanvas canvas(result);
SkRect srcRect = SkRect::Make(SkIRect::MakeXYWH(0, 0, width(), height()));
SkRect dstRect = SkRect::Make(SkIRect::MakeXYWH(0, 0, result.width(), result.height()));
- canvas.drawBitmapRectToRect(m_bitmap, &srcRect, dstRect, &paint);
+ canvas.drawBitmapRect(m_bitmap, srcRect, dstRect, &paint,
+ SkCanvas::kStrict_SrcRectConstraint);
swapBitmap(result);
}
@@ -307,7 +308,9 @@ public:
SkRect srcRect = SkRect::Make(SkIRect::MakeXYWH(srcx, srcy, width, height));
SkRect dstRect = SkRect::Make(SkIRect::MakeXYWH(dstx, dsty, width, height));
- ((SkiaSurface*)dest)->m_canvas->drawBitmapRectToRect(m_bitmap, &srcRect, dstRect, &paint);
+ ((SkiaSurface*)dest)->m_canvas->drawBitmapRect(
+ m_bitmap, srcRect, dstRect, &paint,
+ SkCanvas::kStrict_SrcRectConstraint);
}
}
@@ -363,8 +366,9 @@ public:
SkPaint paint;
paint.setXfermodeMode(SkXfermode::kSrc_Mode);
- m_canvas->drawBitmapRectToRect(
- ((SkiaSurface*)src)->m_bitmap, &srcRect, dstRect, &paint);
+ m_canvas->drawBitmapRect(
+ ((SkiaSurface*)src)->m_bitmap, srcRect, dstRect, &paint,
+ SkCanvas::kStrict_SrcRectConstraint);
}
void drawRgbaSurface(const LockedSurface* src, int dstx, int dsty) override {
@@ -381,8 +385,9 @@ public:
SkPaint paint;
paint.setXfermodeMode(SkXfermode::kSrcOver_Mode);
- m_canvas->drawBitmapRectToRect(
- ((SkiaSurface*)src)->m_bitmap, &srcRect, dstRect, &paint);
+ m_canvas->drawBitmapRect(
+ ((SkiaSurface*)src)->m_bitmap, srcRect, dstRect, &paint,
+ SkCanvas::kStrict_SrcRectConstraint);
}
void drawColoredRgbaSurface(const LockedSurface* src, gfx::Color fg, gfx::Color bg, const gfx::Clip& clipbase) override {
@@ -407,9 +412,10 @@ public:
SkColorFilter::CreateModeFilter(to_skia(fg), SkXfermode::kSrcIn_Mode));
paint.setColorFilter(colorFilter);
- m_canvas->drawBitmapRectToRect(
+ m_canvas->drawBitmapRect(
((SkiaSurface*)src)->m_bitmap,
- &srcRect, dstRect, &paint);
+ srcRect, dstRect, &paint,
+ SkCanvas::kStrict_SrcRectConstraint);
}
void drawChar(Font* font, gfx::Color fg, gfx::Color bg, int x, int y, int chr) override {
diff --git a/src/she/skia/skia_system.h b/src/she/skia/skia_system.h
index dbe45b9..71b9e9e 100644
--- a/src/she/skia/skia_system.h
+++ b/src/she/skia/skia_system.h
@@ -82,7 +82,7 @@ public:
Surface* loadSurface(const char* filename) override {
base::FileHandle fp(base::open_file_with_exception(filename, "rb"));
- SkAutoTDelete<SkStreamAsset> stream(SkNEW_ARGS(SkFILEStream, (fp.get(), SkFILEStream::kCallerRetains_Ownership)));
+ SkAutoTDelete<SkStreamAsset> stream(new SkFILEStream(fp.get(), SkFILEStream::kCallerRetains_Ownership));
SkAutoTDelete<SkImageDecoder> decoder(SkImageDecoder::Factory(stream));
if (decoder) {
diff --git a/src/she/skia/skia_window_win.cpp b/src/she/skia/skia_window_win.cpp
index 260d184..41f1797 100644
--- a/src/she/skia/skia_window_win.cpp
+++ b/src/she/skia/skia_window_win.cpp
@@ -122,7 +122,7 @@ void SkiaWindow::paintHDC(HDC hdc)
bool SkiaWindow::attachGL()
{
if (!m_glCtx) {
- GLContextWGL* wglCtx = SkNEW_ARGS(GLContextWGL, (handle(), kGLES_GrGLStandard));
+ GLContextWGL* wglCtx = new GLContextWGL(handle(), kGLES_GrGLStandard);
m_stencilBits = wglCtx->getStencilBits();
m_sampleCount = wglCtx->getSampleCount();
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git
More information about the Pkg-games-commits
mailing list